From 76723a083cd512f781cc4676ca8a4fb427b4b9fe Mon Sep 17 00:00:00 2001 From: Peter Pronai Date: Thu, 26 Jun 2025 13:12:13 +0000 Subject: [PATCH] Normalize YAML files and generate random ids As explained in the added REAME.md file, there were serious problems with git conflicts between PRs that add new diagnostic messages. This commit adds a script (`normalize_yaml`) that makes the contribution process a lot smoother and less error prone. Fixes #25929 internal issue. Issue: https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/ICHUGM Signed-off-by: Peter Pronai Change-Id: Idad9ff2dbbc98a62126c27e0dc396c223ceaee7c --- .../declgen_ets2ts/declgen_ets2ts_error.yaml | 47 +- .../declgen_ets2ts_warning.yaml | 3 + .../declgen_ets2ts/isolated_declgen.yaml | 39 +- ets2panda/scripts/normalize_yaml | 170 ++ ets2panda/util/diagnostic/README.md | 19 + .../util/diagnostic/arktsconfig_error.yaml | 88 +- ets2panda/util/diagnostic/diagnostic.rb | 33 +- ets2panda/util/diagnostic/fatal.yaml | 141 +- ets2panda/util/diagnostic/semantic.yaml | 2325 +++++++++-------- ets2panda/util/diagnostic/syntax.yaml | 1948 +++++++------- ets2panda/util/diagnostic/warning.yaml | 121 +- 11 files changed, 2609 insertions(+), 2325 deletions(-) create mode 100755 ets2panda/scripts/normalize_yaml create mode 100644 ets2panda/util/diagnostic/README.md diff --git a/ets2panda/declgen_ets2ts/declgen_ets2ts_error.yaml b/ets2panda/declgen_ets2ts/declgen_ets2ts_error.yaml index 392309b9b7..71d68c0c7f 100644 --- a/ets2panda/declgen_ets2ts/declgen_ets2ts_error.yaml +++ b/ets2panda/declgen_ets2ts/declgen_ets2ts_error.yaml @@ -12,25 +12,14 @@ # limitations under the License. declgen_ets2ts_error: + - name: IDENT_KEY_SUPPORT id: 1 message: Only identifier keys are supported. -- name: UNSUPPORTED_TYPE - id: 2 - message: Unsupported type {}. - -- name: UNSUPPORTED_LITERAL_TYPE - id: 3 - message: Unsupported literal type. - -- name: UNEXPECTED_NUMBER_LITERAL_TYPE - id: 4 - message: Unexpected number literal type. - -- name: NOT_OVERLOAD_SUPPORT - id: 5 - message: Method overloads are not supported. +- name: IMPORT_SPECIFIERS_SUPPORT + id: 8 + message: Only import specifiers are supported. - name: INCORRECT_ENUM_MEMBER id: 6 @@ -40,14 +29,30 @@ declgen_ets2ts_error: id: 7 message: Only literal enum initializers are supported. -- name: IMPORT_SPECIFIERS_SUPPORT - id: 8 - message: Only import specifiers are supported. +- name: NOT_OVERLOAD_SUPPORT + id: 5 + message: Method overloads are not supported. + +- name: UNEXPECTED_NUMBER_LITERAL_TYPE + id: 4 + message: Unexpected number literal type. + +- name: UNSUPPORTED_ENCODING_SPECIFICATIONS + id: 10 + message: The source file does not comply with the encoding specifications. For details, please see the following error + information. + +- name: UNSUPPORTED_LITERAL_TYPE + id: 3 + message: Unsupported literal type. - name: UNSUPPORTED_LOCAL_BINDINGS id: 9 message: Imports with local bindings are not supported. -- name: UNSUPPORTED_ENCODING_SPECIFICATIONS - id: 10 - message: The source file does not comply with the encoding specifications. For details, please see the following error information. +- name: UNSUPPORTED_TYPE + id: 2 + message: Unsupported type {}. + +graveyard: [] +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/declgen_ets2ts/declgen_ets2ts_warning.yaml b/ets2panda/declgen_ets2ts/declgen_ets2ts_warning.yaml index 610c7d89a1..48ad687679 100644 --- a/ets2panda/declgen_ets2ts/declgen_ets2ts_warning.yaml +++ b/ets2panda/declgen_ets2ts/declgen_ets2ts_warning.yaml @@ -12,6 +12,7 @@ # limitations under the License. declgen_ets2ts_warning: + - name: EMPTY_TYPE_NAME id: 1 message: Object type name is empty. @@ -19,3 +20,5 @@ declgen_ets2ts_warning: - name: UNTYPED_METHOD id: 2 message: Untyped method encountered {}. +graveyard: [] +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/declgen_ets2ts/isolated_declgen.yaml b/ets2panda/declgen_ets2ts/isolated_declgen.yaml index bfde0c6897..af8bb6fe7f 100644 --- a/ets2panda/declgen_ets2ts/isolated_declgen.yaml +++ b/ets2panda/declgen_ets2ts/isolated_declgen.yaml @@ -11,25 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. isolated_declgen: -- name: VARABLE_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL - id: 1 - message: Variable must have an explicit type annotation when using isolated declaration. - -- name: PARAMETER_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL - id: 2 - message: Parameter must have an explicit type annotation when using isolated declaration. - -- name: PROPERTY_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL - id: 3 - message: Property must have an explicit type annotation when using isolated declaration. - -- name: ONLY_CONST_ARRAYS_CAN_BE_INFERRED_WITH_ISOLATED_DECL - id: 4 - message: Only const arrays can be inferred with isolated declaration. - name: DECLARATION_EMIT_FOR_THIS_PARAMETER_REQUIRES_IMPLICITLY_ADD_UNDEFINED_TO_ITS_TYPE_NOT_ALLOWED_IN_ISOLATED_DECL id: 5 - message: Declaration emit for this parameter requires implicitly adding undefined to its type, which is not allowed in isolated declaration. + message: Declaration emit for this parameter requires implicitly adding undefined to its type, which is not allowed in + isolated declaration. - name: DEFAULT_EXPORTS_CANNOT_BE_INFERRED_WITH_ISOLATED_DECL id: 6 @@ -41,4 +27,23 @@ isolated_declgen: - name: METHOD_MUST_HAVE_AN_EXPLICIT_RETURN_TYPE_ANNOTATION_WITH_ISOLATED_DECL id: 8 - message: Method must have an explicit return type annotation when using isolated declaration. \ No newline at end of file + message: Method must have an explicit return type annotation when using isolated declaration. + +- name: ONLY_CONST_ARRAYS_CAN_BE_INFERRED_WITH_ISOLATED_DECL + id: 4 + message: Only const arrays can be inferred with isolated declaration. + +- name: PARAMETER_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL + id: 2 + message: Parameter must have an explicit type annotation when using isolated declaration. + +- name: PROPERTY_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL + id: 3 + message: Property must have an explicit type annotation when using isolated declaration. + +- name: VARABLE_MUST_HAVE_EXPLICIT_TYPE_ANNOTATION_WITH_ISOLATED_DECL + id: 1 + message: Variable must have an explicit type annotation when using isolated declaration. + +graveyard: [] +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/scripts/normalize_yaml b/ets2panda/scripts/normalize_yaml new file mode 100755 index 0000000000..71ff8527fc --- /dev/null +++ b/ets2panda/scripts/normalize_yaml @@ -0,0 +1,170 @@ +#!/usr/bin/env python3 +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE(pronai) need idempotence test and negative tests for non-normal YAMLs + +import io +import os +import posixpath +import shutil +import subprocess +import sys +# YAML parser/dumper that preserves formatting +from ruamel import yaml +import numpy as np +import math + +usage = f"""\ +Usage: {sys.argv[0]} [--all] inputs + + inputs: a (possibly empty) list of paths to diagnostic YAMLs + --all: run on all YAMLs that look like they include diagnostics + -h | --help: print this help + """ + +permissible_collision_chance = 0.001 +simultaneous_commits = 10 +# how many new ids each commit adds, based on analysis of previous commits, this is ceil(avg) +# it must be a positive int +ids_per_commit = 2 +# we model commits with multiple ids as two commits +# this makes the math a lot easier and is a pessimistic approximation +effective_alloc_rate = simultaneous_commits * ids_per_commit + + +# see https://en.wikipedia.org/wiki/Birthday_problem +def collision_prob(n): + # the factorials are optimized away + return 1 - math.prod(range(n - effective_alloc_rate + 1, n+1)) / n ** effective_alloc_rate + +# binary search for a solution +def compute_range(): + min_range = effective_alloc_rate + upper_bound = min_range + lower_bound = min_range + step = 1 + while collision_prob(upper_bound) >= permissible_collision_chance: + lower_bound = upper_bound + upper_bound+=step + step*=2 + while lower_bound < upper_bound: + mid = (upper_bound+lower_bound)/2 + # n must be integer + mid_lo = math.floor(mid) + mid_hi = math.ceil(mid) + p_lo = collision_prob(mid_lo) + p_hi = collision_prob(mid_hi) + # higher n gives lower p! + if p_hi > permissible_collision_chance: + # p is too high, need higher n + lower_bound = mid_hi + else: # p_hi <= permissible_collision_chance + if permissible_collision_chance > p_lo: + upper_bound = mid_lo + else: # permissible_collision_chance <= p_lo + min_range = mid_hi + break + return min_range + +min_range = compute_range() + +# needed to make sure we are using the right numpy dtype +assert math.ceil(math.log2(min_range))<32 +dtype = np.uint32 + +def normalize(in_path): + out_path = in_path + ".new" + with open(in_path) as in_file, open(out_path, "w+") as out_file: + parser = yaml.YAML() + parser.preserve_quotes = True + parser.width = 120 + docs = parser.load(in_file) + doc = docs[next(iter(docs.keys()))] + doc.sort(key=lambda item: item['name']) + rng = np.random.default_rng() + if "graveyard" in docs: + docs["graveyard"].sort() + for diagnostic in doc: + if "id" in diagnostic and "graveyard" in docs: + continue + # we re-compute this every time because it's easier than splitting the ranges after each allocation + # it can be optimized later if necessary + # either way, we only add 1-2 IDs in each commit, so at most it doubles the run time + allocated = np.fromiter((int(diagnostic['id']) for diagnostic in doc if 'id' in diagnostic), dtype) + # add 0 as sentinel value, so we can deal with deletions + # 1 is the first actually available id, it's taken as of press time, but it might not remain that way + allocated = np.append(allocated, [0]) + allocated.sort() + if "graveyard" not in docs: + print(f"{in_path}: filling graveyard") + docs.insert(len(docs), "graveyard", sorted(list(set(range(1, allocated[-1]+1)).difference(set(allocated))))) + if 'id' in diagnostic: + continue + allocated = np.append(allocated, docs["graveyard"]) + allocated.sort() + gaps = allocated[1:]-allocated[:-1]-1 + gaps = np.append(gaps, [min_range-gaps.sum()]) + non_unique = gaps<0 + assert len(gaps) == len(allocated) + if np.any(non_unique): + raise ValueError(f"Non unique ids in yaml {in_path}:", allocated[non_unique]) + # choose from the available intervals using their size as weight + p = gaps + # need to normalize them so they sum to 1 + p = p / np.sum(p, dtype=float) + ival_id = rng.choice(len(allocated), p=p) + ival_start = 1+allocated[ival_id] + ival_size = gaps[ival_id] + # generate a random number from the interval + iid = ival_start+rng.choice(ival_size) + gaps[ival_id]-=1 + diagnostic.insert(1, 'id', int(iid)) + sio = io.StringIO() + parser.dump(docs, sio) + contents = sio.getvalue() + # make sure there is at least one blank line before each list item + prev="not blank" + for line in contents.splitlines(keepends=True): + # print("prev", prev) + # print("line", line) + if line.lstrip().startswith("- name:") and prev.strip()!="": + out_file.write("\n") + pass + out_file.write(line) + prev=line + usage_comment = "# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing.\n" + if prev.strip() != usage_comment.strip(): + out_file.write(usage_comment) + os.rename(out_path, in_path) + +def known_file_paths(): + repo_base = posixpath.dirname(shutil.which(sys.argv[0])) + "/../../" + for relative in subprocess.run(["git", "grep", "--files-with-matches", "-e" "^ message:", "--", "**.yaml"], cwd = repo_base, stdout=subprocess.PIPE).stdout.decode().splitlines(): + yield repo_base + relative + +def main(): + params = sys.argv[1:] + if "-h" in sys.argv or "--help" in params: + print(usage, file=sys.stderr) + sys.exit(1) + if "--all" in params: + params = [p for p in params if p != "--all"] + for path in known_file_paths(): + params.append(path) + for path in params: + print("Processing", path) + normalize(path) + +if __name__ == "__main__": + main() diff --git a/ets2panda/util/diagnostic/README.md b/ets2panda/util/diagnostic/README.md new file mode 100644 index 0000000000..042c927578 --- /dev/null +++ b/ets2panda/util/diagnostic/README.md @@ -0,0 +1,19 @@ +# Diagnostic YAMLs +These files encode the various diagnostic messages that es2panda might emit. + +## Adding new diagnostics +When adding a new diagnostic, adding them at the end *guarantees* conflicts between PRs. We avoid that by keeping the lists sorted by name. + +Keeping them sorted still doesn't solve the issue of two PRs trying to add diagnostics with the same id. We mostly solve that by *not* choosing the numbers by hand, nor just incrementing them, but by generating them randomly. + +Both are achieved by running `ets_frontend/ets2panda/scripts/normalize_yaml somefile.yaml`, where `somefile.yaml` is the one you have added new messages to. + +You can also run `normalize_yaml --all` to normalize all diagnostic YAMLs. + +## Deleting diagnostics +To avoid accidentally re-using old ids, please move them into the `graveyard` list at the end of the file. These are forever forbidden from being emitted by the compiler. + +See `semantic.yaml` for an example of how it should look. + +## Checking +YAMLs are checked at build time in `ets_frontend/ets2panda/util/diagnostic/diagnostic.rb`. \ No newline at end of file diff --git a/ets2panda/util/diagnostic/arktsconfig_error.yaml b/ets2panda/util/diagnostic/arktsconfig_error.yaml index e03085e195..d839babae0 100644 --- a/ets2panda/util/diagnostic/arktsconfig_error.yaml +++ b/ets2panda/util/diagnostic/arktsconfig_error.yaml @@ -12,45 +12,22 @@ # limitations under the License. arkts_config_error: -- name: UNRESOLVABLE_CONFIG_PATH - id: 1 - message: Can't resolve config path {} - name: CYCLIC_IMPORT id: 2 message: Encountered cyclic import in 'extends' field -- name: WRONG_BASE_CONFIG - id: 3 - message: Failed to parse base config {} - -- name: INVALID_VALUE - id: 4 - message: Invalid value for '{}' with key '{}' - -- name: EMPTY_ARRAY_SUBSTITOTIONS - id: 5 - message: Substitutions for pattern '{}' shouldn't be an empty array - -- name: INVALID_LANGUAGE - id: 6 - message: Invalid '{}' value for dynamic path with key '{}'. Should be one of {} - -- name: UNSUPPORTED_LANGUAGE_FOR_INTEROP - id: 7 - message: Interoperability with language '{}' is not supported - -- name: INVALID_NAMED_VALUE - id: 8 - message: Invalid {} value for '{}' with key '{}' +- name: DEPENDENCIES_ABSOLUTE + id: 18 + message: "Don't use absolute path '{}' as key in 'dependencies'" - name: DUPLICATED_DEPENDENCIES id: 9 message: Duplicated dynamic path '{}' for key '{}' -- name: INVALID_JSON_TYPE - id: 10 - message: The '{}' must have {} type +- name: EMPTY_ARRAY_SUBSTITOTIONS + id: 5 + message: Substitutions for pattern '{}' shouldn't be an empty array - name: EMPTY_LIST id: 11 @@ -60,26 +37,53 @@ arkts_config_error: id: 12 message: Failed to open file {} +- name: INVALID_DESTINATION_FILE + id: 16 + message: Invalid destination file + - name: INVALID_JSON id: 13 message: ArkTsConfig is not valid json -- name: NO_FILE - id: 14 - message: No such file {} +- name: INVALID_JSON_TYPE + id: 10 + message: The '{}' must have {} type -- name: NOT_ROOT_DIR - id: 15 - message: '{} is not root directory for {}' - -- name: INVALID_DESTINATION_FILE - id: 16 - message: Invalid destination file +- name: INVALID_LANGUAGE + id: 6 + message: Invalid '{}' value for dynamic path with key '{}'. Should be one of {} + +- name: INVALID_NAMED_VALUE + id: 8 + message: Invalid {} value for '{}' with key '{}' - name: INVALID_PATH id: 17 message: Invalid path for '{}' in dependencies -- name: DEPENDENCIES_ABSOLUTE - id: 18 - message: "Don't use absolute path '{}' as key in 'dependencies'" \ No newline at end of file +- name: INVALID_VALUE + id: 4 + message: Invalid value for '{}' with key '{}' + +- name: NOT_ROOT_DIR + id: 15 + message: '{} is not root directory for {}' + +- name: NO_FILE + id: 14 + message: No such file {} + +- name: UNRESOLVABLE_CONFIG_PATH + id: 1 + message: Can't resolve config path {} + +- name: UNSUPPORTED_LANGUAGE_FOR_INTEROP + id: 7 + message: Interoperability with language '{}' is not supported + +- name: WRONG_BASE_CONFIG + id: 3 + message: Failed to parse base config {} + +graveyard: [] +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/util/diagnostic/diagnostic.rb b/ets2panda/util/diagnostic/diagnostic.rb index 0e83ecce9e..d770ba5b0e 100644 --- a/ets2panda/util/diagnostic/diagnostic.rb +++ b/ets2panda/util/diagnostic/diagnostic.rb @@ -25,9 +25,40 @@ module Diagnostic @diagnostics end + def normalization_error + warn "You probably need to run 'normalize_yaml', see ets_frontend/ets2panda/util/diagnostic/README.md" + Kernel.exit 1 + end + def wrap_data(data) + graveyard = data.delete_field(:graveyard) + data.freeze + graveyard.each_cons(2) do |lhs, rhs| + if lhs >= rhs + warn "Graveyard is not strictly monotonically sorted, '#{lhs}' should come before '#{rhs}'" + normalization_error + end + end + graveyard = graveyard.to_set data.each_pair do |diagnostic_type, diagnostics| - diagnostics.each.with_index(1) do |diagnostic, index| + # Check if the YAML is in normal form according to ets_frontend/ets2panda/util/diagnostic/normalize_yaml + diagnostics.map(&:name).each_cons(2) do |lhs, rhs| + if lhs >= rhs + warn "Message with name '#{lhs}' should come after '#{rhs}' for diagnostic type '#{diagnostic_type}'" + normalization_error + end + end + diagnostics.map(&:id).each do |id| + if graveyard.member? id + warn "'#{id}' used for diagnostic type #{diagnostic_type} is already in the graveyard, let it rest in peace" + normalization_error + end + end + diagnostics.map(&:id).group_by(&:itself).select{ |_, v| v.size > 1 }.map(&:first).each do |duplicate| + warn "Duplicate id '#{duplicate}' for diagnostic type '#{diagnostic_type}'" + normalization_error + end + diagnostics.each do |diagnostic| diagnostic.type = diagnostic_type @diagnostics.append(diagnostic) end diff --git a/ets2panda/util/diagnostic/fatal.yaml b/ets2panda/util/diagnostic/fatal.yaml index 5cd4141733..be12c9338f 100644 --- a/ets2panda/util/diagnostic/fatal.yaml +++ b/ets2panda/util/diagnostic/fatal.yaml @@ -12,106 +12,111 @@ # limitations under the License. fatal: -- name: TBD1 - id: 1 - message: . -- name: OPEN_FAILED - id: 2 - message: "Failed to open file: {}" +- name: ASSIGN_PROFILE_INFO_FAILED + id: 23 + message: "AssignProfileInfo failed" -- name: NO_INPUT - id: 3 - message: "No files to compile" +- name: COMPILE_FAILED + id: 21 + message: "Failed to compile from {} to {}" -- name: PLUGIN_LOAD_FAILED - id: 4 - message: "Failed to load plugin {}" +- name: DUMP_ETS_INVALID_EXT + id: 8 + message: "--dump-ets-src-* option is valid only with ETS extension" + +- name: EMIT_FAILED + id: 22 + message: "Failed to emit binary data: {}" + +- name: EMPTY_IMPORT_PATH + id: 15 + message: "Import path cannot be empty" - name: EVAL_MODE_NOT_SINGLE_INPUT id: 5 message: "When compiling with --debugger-eval-mode single input file must be provided" -- name: PROJ_COMP_WITH_OUTPUT - id: 6 - message: "When compiling in project mode --output key is not needed" - -- name: MODULE_INVALID_EXT - id: 7 - message: "--module is not supported for this extension." - -- name: DUMP_ETS_INVALID_EXT - id: 8 - message: "--dump-ets-src-* option is valid only with ETS extension" +- name: GENERATE_DYNAMIC_DECLARATIONS + id: 24 + message: "Genate dynamic declarations, outputDeclEts and outputEts must be set together." -- name: PROJECT_EXT_NOT_ETS - id: 9 - message: "Error: only '--extension=ets' is supported for project compilation mode." +- name: IMPORT_CANT_FIND_PREFIX + id: 16 + message: "Can't find prefix for '{}' in {}" -- name: UNKNOWN_EXT - id: 10 - message: "Unknown extension of sourcefile, set the '--extension' option or change the file extension (available options: js, ts, as, ets)" +- name: INVALID_ARKTSCONFIG + id: 13 + message: "Invalid ArkTsConfig: {}" - name: JS_UNSUPPORTED id: 11 message: "js extension is not supported within current build" -- name: OPEN_FAILED_ARKTSCONF - id: 12 - message: "Failed to open arktsconfig: {}" +- name: MISSING_OUTPUT_FILE + id: 25 + message: "Output file path must be specified." -- name: INVALID_ARKTSCONFIG - id: 13 - message: "Invalid ArkTsConfig: {}" +- name: MODULE_INVALID_EXT + id: 7 + message: "--module is not supported for this extension." -- name: UNRESOLVED_MODULE - id: 14 - message: "Unresolved module name {}" +- name: NO_INPUT + id: 3 + message: "No files to compile" -- name: EMPTY_IMPORT_PATH - id: 15 - message: "Import path cannot be empty" +- name: OPEN_FAILED + id: 2 + message: "Failed to open file: {}" -- name: IMPORT_CANT_FIND_PREFIX - id: 16 - message: "Can't find prefix for '{}' in {}" +- name: OPEN_FAILED_ARKTSCONF + id: 12 + message: "Failed to open arktsconfig: {}" - name: OPEN_FOLDER_FAILED id: 17 message: "Cannot open folder: {}" -- name: UNAVAILABLE_SRC_PATH - id: 18 - message: "Not an available source path: {}" +- name: PLUGIN_LOAD_FAILED + id: 4 + message: "Failed to load plugin {}" -- name: UNSUPPORTED_PATH - id: 19 - message: "Not supported path: {}" +- name: PROJECT_EXT_NOT_ETS + id: 9 + message: "Error: only '--extension=ets' is supported for project compilation mode." + +- name: PROJ_COMP_WITH_OUTPUT + id: 6 + message: "When compiling in project mode --output key is not needed" + +- name: SIMULTANEOUSLY_MARK_FAILED + id: 26 + message: "simultaneously compile is not work because of input file paths error." - name: SOURCE_OUTSIDE_ETS_PATH id: 20 message: "Source file {} outside ets-path" -- name: COMPILE_FAILED - id: 21 - message: "Failed to compile from {} to {}" +- name: TBD1 + id: 1 + message: . -- name: EMIT_FAILED - id: 22 - message: "Failed to emit binary data: {}" +- name: UNAVAILABLE_SRC_PATH + id: 18 + message: "Not an available source path: {}" -- name: ASSIGN_PROFILE_INFO_FAILED - id: 23 - message: "AssignProfileInfo failed" +- name: UNKNOWN_EXT + id: 10 + message: "Unknown extension of sourcefile, set the '--extension' option or change the file extension (available options: + js, ts, as, ets)" -- name: GENERATE_DYNAMIC_DECLARATIONS - id: 24 - message: "Genate dynamic declarations, outputDeclEts and outputEts must be set together." +- name: UNRESOLVED_MODULE + id: 14 + message: "Unresolved module name {}" -- name: MISSING_OUTPUT_FILE - id: 25 - message: "Output file path must be specified." +- name: UNSUPPORTED_PATH + id: 19 + message: "Not supported path: {}" -- name: SIMULTANEOUSLY_MARK_FAILED - id: 26 - message: "simultaneously compile is not work because of input file paths error." +graveyard: [] +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/util/diagnostic/semantic.yaml b/ets2panda/util/diagnostic/semantic.yaml index 8de38bb1ef..0def07ffc8 100644 --- a/ets2panda/util/diagnostic/semantic.yaml +++ b/ets2panda/util/diagnostic/semantic.yaml @@ -12,158 +12,118 @@ # limitations under the License. semantic: -- name: ASYNC_FUNCTION_RETURN_TYPE - id: 1 - message: Return type of async function must be 'Promise'. - -- name: NO_CALL_SIGNATURE - id: 2 - message: Type '{}' has no call signatures. - -- name: INVALID_ANNOTATION_RETENTION - id: 3 - message: Annotation '@Retention' can only be applied to annotation declarations. - -- name: ANNOTATION_POLICY_INVALID - id: 4 - message: Invalid value for 'policy' field. The policy must be one of the following:'SOURCE', 'CLASS', or 'RUNTIME'. - -- name: ANNOTATION_ON_LAMBDA_LOCAL_TYPE - id: 5 - message: Annotations without 'SOURCE' cannot be used on lambda expressions, local declarations, or types. - -- name: STANDARD_ANNOTATION_REQUIRED - id: 6 - message: Only standard annotations are allowed to be applied on annotations. - -- name: TYPE_PARAMETER_AS_ARRAY_ELEMENT_TYPE - id: 7 - message: Cannot use array creation expression with type parameter. - -- name: VOID_IN_LOGIC - id: 9 - message: "An expression of type 'void' cannot be tested for truthiness" - -- name: POSSIBLY_NULLISH - id: 10 - message: "Value is possibly nullish." - -- name: ILLEGAL_UNARY_OP - id: 11 - message: "Illegal unary operator." -- name: ANNOTATION_FIELD_NONLITERAL - id: 12 - message: "Invalid value for annotation field, expected a constant literal." +- name: ABSTRACT_CALL + id: 26 + message: "Cannot call abstract method!" -- name: EXCEPTION_REDECLARATION - id: 13 - message: "Redeclaration of exception type" +- name: ABSTRACT_CLASS_AS_ARRAY_ELEMENT_TYPE + id: 50 + message: "Cannot use array creation expression with abstract classes and interfaces." -- name: STATIC_INIT_IN_NESTED_CLASS - id: 14 - message: "Static initializer is not allowed in inner class." +- name: ABSTRACT_INSTANTIATION + id: 52 + message: "{} is abstract therefore cannot be instantiated." -- name: NATIVE_WITHOUT_RETURN - id: 15 - message: "'Native' method should have explicit return type" +- name: ABSTRACT_IN_CONCRETE + id: 19 + message: "Non abstract class has abstract method." -- name: FUNC_EXPR_INVALID - id: 16 - message: "Invalid function expression" +- name: ABSTRACT_IS_FINAL + id: 186 + message: "Cannot use both 'final' and 'abstract' modifiers." -- name: FUNCTION_WITHOUT_BODY - id: 17 - message: "Only abstract or native methods can't have body." +- name: ABSTRACT_METHOD_INVALID_MODIFIER + id: 47 + message: "Invalid method modifier(s): an abstract method can't have private, override, static, final or native modifier." -- name: MISSING_RETURN_TYPE - id: 18 - message: "Native and Declare methods should have explicit return type." +- name: ABSTRACT_METH_IN_ABSTRACT_CLASS + id: 257 + message: "Abstract class has abstract method {}" -- name: ABSTRACT_IN_CONCRETE - id: 19 - message: "Non abstract class has abstract method." +- name: ACCESSORS_MOD_MISMATCH + id: 220 + message: "Getter and setter methods must have the same accessor modifiers" -- name: UNSUPPORTED_CLASS_LITERAL - id: 20 - message: "Class literal is not yet supported." +- name: AMBIENT_ANNOT_FIELD_INIT_MISMATCH + id: 36 + message: "The initial value does not match the expected value." -- name: INVALID_DOT_CLASS - id: 21 - message: "Invalid .class reference" +- name: AMBIENT_ANNOT_FIELD_MISMATCH + id: 39 + message: "Initializer for field '{}' does not match the expected definition in the ambient annotation '{}'." -- name: ARRAY_OF_NEVER - id: 22 - message: "Cannot use array creation expression with never type." +- name: AMBIENT_ANNOT_FIELD_MISSING_IMPL + id: 40 + message: "Field '{}' in annotation '{}' is declared in the ambient declaration but missing in the implementation." -- name: ASYNC_DOESNT_PROMISE - id: 23 - message: "Return type of async lambda must be 'Promise'" +- name: AMBIENT_ANNOT_FIELD_TYPE_MISMATCH + id: 38 + message: "Field '{}' has a type mismatch with the ambient annotation '{}'." -- name: ARRAY_LENGTH_MODIFICATION - id: 24 - message: "Setting the length of an array is not permitted" +- name: AMBIENT_ANNOT_IMPL_OF_UNDEFINED_FIELD + id: 37 + message: "Field '{}' is not defined in the ambient annotation '{}'" -- name: ASSIGNMENT_INVALID_LHS - id: 25 - message: "Invalid left-hand side of assignment expression" - code_fix_ids: [FixConvertConstToLet] +- name: AMBIENT_CONST_INVALID_LIT + id: 175 + message: "A 'const' initializer in an ambient context must be a string or numeric literal: {}" -- name: ABSTRACT_CALL - id: 26 - message: "Cannot call abstract method!" +- name: AMBIGUOUS_CALL + id: 142 + message: "Call to `{}` is ambiguous as `2` versions of `{}` are available: `{}{}` and `{}{}`" -- name: READONLY_CALL - id: 27 - message: "Cannot call readonly type methods." +- name: AMBIGUOUS_CALL_2 + id: 129 + message: "Call to `{}` is ambiguous " -- name: TEMPLATE_COUNT_MISMATCH - id: 28 - message: "Invalid string template expression" +- name: AMBIGUOUS_EXPORT + id: 362 + message: "Ambiguous export '{}'" -- name: ASSERT_MESSAGE_NOT_STRING - id: 30 - message: "Assert message must be string" +- name: AMBIGUOUS_FUNC_INIT + id: 154 + message: "Ambiguous function initialization because of multiple overloads" -- name: RETURN_THIS_OUTSIDE_METHOD - id: 31 - message: "Only extension function or a class method can return 'this'" +- name: AMBIGUOUS_FUNC_REF + id: 126 + message: "Reference to {} is ambiguous" -- name: RETURN_WITHOUT_VALUE - id: 32 - message: "Missing return value." +- name: AMBIGUOUS_REFERENCE + id: 61 + message: "Ambiguous reference to '{}'" -- name: NON_VOID_RETURN_IN_CONSTRUCTOR - id: 33 - message: "Return statement with expression isn't allowed in constructor." +- name: AMBIGUOUS_UNION_TYPE_OP + id: 255 + message: "Ambiguous union type operation" -- name: CATCH_DEFAULT_NOT_LAST - id: 34 - message: "Default catch clause should be the last in the try statement" +- name: ANALYSIS_ERRORS + id: 119 + message: "There were errors during assign analysis ({})" -- name: ENUM_TYPE_INVALID - id: 35 - message: "Invalid enumeration value type." +- name: ANNOTATION_ARG_COUNT_MISMATCH + id: 68 + message: "The number of arguments provided for the annotation exceeds the number of fields defined." -- name: AMBIENT_ANNOT_FIELD_INIT_MISMATCH - id: 36 - message: "The initial value does not match the expected value." +- name: ANNOTATION_AS_TYPE + id: 159 + message: "Annotations cannot be used as a type." -- name: AMBIENT_ANNOT_IMPL_OF_UNDEFINED_FIELD - id: 37 - message: "Field '{}' is not defined in the ambient annotation '{}'" +- name: ANNOTATION_FIELD_NONLITERAL + id: 12 + message: "Invalid value for annotation field, expected a constant literal." -- name: AMBIENT_ANNOT_FIELD_TYPE_MISMATCH - id: 38 - message: "Field '{}' has a type mismatch with the ambient annotation '{}'." +- name: ANNOTATION_ON_LAMBDA_LOCAL_TYPE + id: 5 + message: Annotations without 'SOURCE' cannot be used on lambda expressions, local declarations, or types. -- name: AMBIENT_ANNOT_FIELD_MISMATCH - id: 39 - message: "Initializer for field '{}' does not match the expected definition in the ambient annotation '{}'." +- name: ANNOTATION_POLICY_INVALID + id: 4 + message: Invalid value for 'policy' field. The policy must be one of the following:'SOURCE', 'CLASS', or 'RUNTIME'. -- name: AMBIENT_ANNOT_FIELD_MISSING_IMPL - id: 40 - message: "Field '{}' in annotation '{}' is declared in the ambient declaration but missing in the implementation." +- name: ANNOTATION_UNUSED_GENERIC_ALIAS + id: 71 + message: "Type alias generic parameter '{}' is not used in type annotation" - name: ANNOT_DUPLICATE id: 41 @@ -171,603 +131,741 @@ semantic: - name: ANNOT_FIELD_INVALID_TYPE id: 42 - message: "Invalid annotation field type. Only numeric, boolean, string, enum, or arrays of these types are permitted for annotation fields." - -- name: ANNOT_MULTIPLE_FIELD - id: 43 - message: "Annotation '{}' requires multiple fields to be specified." + message: "Invalid annotation field type. Only numeric, boolean, string, enum, or arrays of these types are permitted for + annotation fields." - name: ANNOT_FIELD_NO_VAL id: 44 message: "The required field '{}' must be specified. Fields without default values cannot be omitted." +- name: ANNOT_IS_VOID + id: 232 + message: "'void' used as type annotation." + +- name: ANNOT_MULTIPLE_FIELD + id: 43 + message: "Annotation '{}' requires multiple fields to be specified." + - name: ANNOT_PROP_UNDEFINED id: 45 message: "The parameter '{}' does not match any declared property in the annotation '{}'." -- name: TYPE_MISMATCH_AT_IDX - id: 46 - message: "Type '{}' is not compatible with type '{}' at index {}" +- name: ANNOT_WITHOUT_AT + id: 230 + message: "Annotation missing '@' symbol before annotation name." -- name: ABSTRACT_METHOD_INVALID_MODIFIER - id: 47 - message: "Invalid method modifier(s): an abstract method can't have private, override, static, final or native modifier." +- name: ARG_IS_CLASS_ID + id: 122 + message: "Class name can't be the argument of function or method." -- name: FINAL_METHOD_INVALID_MODIFIER - id: 48 - message: "Invalid method modifier(s): a final method can't have abstract or static modifier." +- name: ARRAY_ELEMENT_INIT_TYPE_INCOMPAT + id: 227 + message: "Array element at index {} with type '{}' is not compatible with the target array element type '{}'" -- name: SPREAD_OF_INVALID_TYPE - id: 49 - message: "Spread expression can be applied only to array or tuple type, but '{}' is provided" +- name: ARRAY_ELEMENT_UNASSIGNABLE + id: 54 + message: "Array element type '{}' is not assignable to explicit type '{}'" -- name: ABSTRACT_CLASS_AS_ARRAY_ELEMENT_TYPE - id: 50 - message: "Cannot use array creation expression with abstract classes and interfaces." +- name: ARRAY_LENGTH_MODIFICATION + id: 24 + message: "Setting the length of an array is not permitted" -- name: NON_SUPERTYPE_OF_UNDEFINED_AS_ARRAY_ELEMENT_TYPE - id: 51 - message: "Cannot use array creation expression with non-constructable element type which is non-assignable from undefined." +- name: ARRAY_OF_NEVER + id: 22 + message: "Cannot use array creation expression with never type." -- name: ABSTRACT_INSTANTIATION - id: 52 - message: "{} is abstract therefore cannot be instantiated." +- name: ARROW_TYPE_MISMATCH + id: 91 + message: "Type '{}' is not compatible with the enclosing method's return type '{}'" -- name: NONLITERAL_INSTANTIATION - id: 53 - message: "Required type can be instantiated only with object literal" +- name: ASSERT_MESSAGE_NOT_STRING + id: 30 + message: "Assert message must be string" -- name: ARRAY_ELEMENT_UNASSIGNABLE - id: 54 - message: "Array element type '{}' is not assignable to explicit type '{}'" +- name: ASSIGNMENT_INVALID_LHS + id: 25 + message: "Invalid left-hand side of assignment expression" + code_fix_ids: [FixConvertConstToLet] -- name: INVALID_SPREAD_IN_TUPLE - id: 55 - message: "'{}' cannot be spread in tuple." +- name: ASSIGN_TO_READONLY_PROP + id: 209 + message: "Cannot assign to this property because it is readonly." -- name: TUPLE_SIZE_MISMATCH - id: 56 - message: "Too many elements in array initializer for tuple with size of {}" +- name: ASYNC_DOESNT_PROMISE + id: 23 + message: "Return type of async lambda must be 'Promise'" -- name: TUPLE_UNASSIGNABLE_ARRAY - id: 57 - message: "Array initializer's type is not assignable to tuple type at index: {}" +- name: ASYNC_FUNCTION_RETURN_TYPE + id: 1 + message: Return type of async function must be 'Promise'. -- name: READONLY_ARRAYLIKE_MODIFICATION - id: 58 - message: "Cannot modify an array or tuple content that has the readonly parameter" +- name: AWAITED_NOT_PROMISE + id: 303 + message: "'await' expressions require Promise object as argument." -- name: EXTENSION_ACCESSOR_INVALID_CALL - id: 59 - message: "Extension accessor can't be used as a method call or function call." +- name: BINOP_DYN_UNIMPLEMENTED + id: 112 + message: "Unimplemented case in dynamic type comparison." -- name: UNCALLABLE_TYPE - id: 60 - message: "Type '{}' has no call signatures." +- name: BINOP_INCOMPARABLE + id: 114 + message: "Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type." -- name: AMBIGUOUS_REFERENCE - id: 61 - message: "Ambiguous reference to '{}'" +- name: BINOP_INVALID_TYPE + id: 105 + message: "Operator '{}' cannot be applied to types '{}' and '{}'." -- name: CLASS_COMPOSITE_UNKNOWN_TYPE - id: 62 - message: "need to specify target type for class composite" +- name: BINOP_MISMATCHED_ENUMS + id: 113 + message: "Bad operand type, the types of the operands must be the same enum type." -- name: CLASS_COMPOSITE_INVALID_TARGET - id: 63 - message: "Target type for class composite needs to be an object type, found '{}'" +- name: BINOP_NONARITHMETIC_TYPE + id: 108 + message: "Bad operand type, the types of the operands must be numeric type, enum or String." -- name: OBJECT_LITERAL_NOT_KV - id: 64 - message: "The object literal properties must be key-value pairs" +- name: BINOP_NOT_LOGICAL + id: 110 + message: "Bad operand type, the types of the operands must be of possible condition type." -- name: UNDEFINED_PROPERTY - id: 65 - message: "type {} has no property named {}" +- name: BINOP_NOT_REFERENCE + id: 111 + message: "Both operands have to be reference types" -- name: OPERAND_NOT_NUMERIC - id: 66 - message: "Bad operand type, the type of the operand must be numeric type." +- name: BINOP_NOT_SAME + id: 115 + message: "Bad operand type, the types of the operands must be same type." -- name: NOT_AN_ANNOTATION - id: 67 - message: "'{}' is not an annotation." +- name: BINOP_ON_UNION + id: 106 + message: "Bad operand type: multiple types left in the normalized union type ({}). Unions are not allowed in binary expressions + except equality." -- name: ANNOTATION_ARG_COUNT_MISMATCH - id: 68 - message: "The number of arguments provided for the annotation exceeds the number of fields defined." +- name: BINOP_UNEXPECTED_ERROR + id: 118 + message: "Unexpected type error in binary expression" -- name: ITERATOR_ELEMENT_TYPE_MISMATCH - id: 69 - message: "Source element type '{}' is not assignable to the loop iterator type '{}'." +- name: BINOP_UNION + id: 109 + message: "Bad operand type, unions are not allowed in binary expressions except equality." -- name: NONEXISTENT_TYPE - id: 70 - message: "'{}' type does not exist." +- name: CALLEE_NONCONSTRUCTIBLE + id: 290 + message: "Type '{}' is not constructible." -- name: ANNOTATION_UNUSED_GENERIC_ALIAS - id: 71 - message: "Type alias generic parameter '{}' is not used in type annotation" +- name: CANNOT_INFER_OBJ_LIT + id: 174 + message: "Cannot infer type for {} because class composite needs an explicit target type" -- name: UNEXPECTED_ARRAY - id: 72 - message: "Expected type for array literal should be an array type, got {}" +- name: CANNOT_OVERRIDE + id: 141 + message: "{}{} in {} cannot override {}{} in {} because {}" + +- name: CAST_FAIL_UNREACHABLE + id: 336 + message: "this cast should never fail" + +- name: CAST_TO_NEVER + id: 305 + message: "Cast to 'never' is prohibited" + +- name: CATCH_DEFAULT_NOT_LAST + id: 34 + message: "Default catch clause should be the last in the try statement" + +- name: CATCH_OR_THROW_OF_INVALID_TYPE + id: 205 + message: "Argument must be an instance of '{}' or '{}'" + +- name: CIRCULAR_DEPENDENCY + id: 308 + message: "Circular dependency detected for identifier: {}" - name: CLASS_COMPOSITE_INVALID_KEY id: 73 message: "key in class composite should be either identifier or string literal" -- name: OBJECT_LITERAL_METHOD_KEY - id: 74 - message: "Method '{}' cannot be used as a key of object literal." +- name: CLASS_COMPOSITE_INVALID_TARGET + id: 63 + message: "Target type for class composite needs to be an object type, found '{}'" -- name: FOROF_CANT_INFER_SOURCE - id: 75 - message: "Cannot determine source expression type in the 'for-of' statement." +- name: CLASS_COMPOSITE_UNKNOWN_TYPE + id: 62 + message: "need to specify target type for class composite" -- name: FOROF_SOURCE_NONITERABLE - id: 76 - message: "'For-of' statement source expression is not of iterable type." +- name: CLASS_OR_IFACE_AS_OBJ + id: 294 + message: "Class or interface '{}' cannot be used as object" -- name: STATIC_METHOD_INVALID_MODIFIER - id: 77 - message: "Invalid method modifier(s): a static method can't have abstract, final or override modifier." +- name: COALESCE_NOT_REF + id: 117 + message: "Left-hand side of nullish-coalescing expression must be a reference type." -- name: VOID_VALUE - id: 78 - message: "Cannot use type 'void' as value. " +- name: CONFLICTING_GENERIC_INTERFACE_IMPLS + id: 181 + message: "Implements generic interface '{}' with different instantiations." -- name: EXTENSION_NAME_CONFLICT_WITH_FIELD - id: 79 - message: "The extension accessor or extension function '{}' has the same name with field of class {}" +- name: CONSTANT_FLOATING_POINT_COVERSION + id: 344 + message: "Floating-point value cannot be converted" -- name: EXTENSION_NAME_CONFLICT_WITH_METHOD - id: 80 - message: "The extension accessor '{}' has the same name with method in class {}" +- name: CONSTANT_VALUE_OUT_OF_RANGE + id: 345 + message: "Value is out of range" -- name: EXTENSION_FUNC_NAME_CONFLICT_WITH_METH - id: 81 - message: "The extension function '{}' has the same name with public method in class {}" +- name: CONST_WITHOUT_INIT + id: 363 + message: "Missing initializer in const declaration" -- name: EXTENSION_FUNC_ON_INEXETENSIBLE - id: 82 - message: "Extension function can only defined for class, interface or array." +- name: CTOR_CLASS_NOT_FIRST + id: 201 + message: "Call to '{}' must be first statement in constructor" -- name: UNEXPECTED_FUNC_BODY - id: 83 - message: "Native, Abstract and Declare methods cannot have body." +- name: CTOR_MISSING_SUPER_CALL + id: 192 + message: "Must call super constructor" -- name: NATIVE_WITH_BODY - id: 84 - message: "Native constructor declaration cannot have a body." +- name: CTOR_REF_INVALID_CTX_GLOBAL + id: 203 + message: "Cannot reference '{}' in this context." -- name: SETTER_NONVOID - id: 85 - message: "Setter must have void return type" +- name: CTOR_REF_IN_STATIC_CTX + id: 202 + message: "'{}' cannot be referenced from a static context" -- name: GETTER_VOID - id: 86 - message: "Getter must return a value" +- name: CYCLIC_ALIAS + id: 311 + message: "Circular type alias reference" -- name: PROPERTY_NONEXISTENT - id: 87 - message: "Property '{}' does not exist on type '{}'" +- name: CYCLIC_ALIAS_2 + id: 313 + message: "Type alias {} circularly refences itself" -- name: MAIN_BAD_RETURN - id: 88 - message: "Bad return type, main enable only void or int type." +- name: CYCLIC_CALLEE + id: 381 + message: "Circular call function" -- name: UNEXPECTED_VALUE_RETURN - id: 89 - message: "Unexpected return value, enclosing method return type is void." +- name: CYCLIC_CLASS_SUPER_TYPE + id: 380 + message: "Class's super type is itself" -- name: RETURN_TYPE_MISMATCH - id: 90 - message: "Return statement type is not compatible with the enclosing method's return type." +- name: CYCLIC_INHERITANCE + id: 310 + message: "Cyclic inheritance involving {}." -- name: ARROW_TYPE_MISMATCH - id: 91 - message: "Type '{}' is not compatible with the enclosing method's return type '{}'" +- name: CYCLIC_TYPE_OF + id: 379 + message: "Circular type of reference" -- name: MIXED_VOID_NONVOID - id: 92 - message: "All return statements in the function should be empty or have a value." +- name: CYCLIC_VAR_REF + id: 314 + message: "'{}' is referenced directly or indirectly in its own initializer ot type annotation." -- name: UNEXPECTED_VOID - id: 93 - message: "'{}' shouldn't have void return type." +- name: DEFAULT_DYNAMIC_IMPORT + id: 352 + message: "Default import is currently not implemented in dynamic import" -- name: UNEXPECTED_NONVOID - id: 94 - message: "'{}' should have void return type." +- name: DEFAULT_EXPORT_DIRECT_IMPORTED + id: 353 + message: "Use the default import syntax to import a default exported element" -- name: MISSING_RETURN_TYPE_2 - id: 95 - message: "'{}' doesn't have return type." +- name: DEFAULT_IMPORT_NOT_FOUND + id: 358 + message: "Cannot find default imported element in the target" -- name: RETURN_ISNT_ITERATOR - id: 96 - message: "The return type of '{}' must be a type that implements Iterator interface." +- name: DIFFERENT_SUBSEQ_DECL + id: 316 + message: "Subsequent variable declaration must have the same type. Variable '{}' must be of type '{}', but here has type + '{}'." -- name: INVALID_CONST_ASSIGNMENT - id: 97 - message: "Cannot assign a value to a constant variable {}" +- name: DIFFERENT_SUBSEQ_PROP_DECL + id: 317 + message: "Subsequent variable declaration must have the same type. Variable '{}' must be of type '{}', but here has type + '{}'." -- name: INVALID_READONLY_ASSIGNMENT - id: 98 - message: "Cannot assign a value to a readonly variable {}" +- name: DISJOINT_CONVERSION + id: 322 + message: "Conversion of type '{}' to type '{}' may be a mistake because neither type sufficiently overlaps with the other. + If this was intentional, convert the expression to 'unknown' first." -- name: ITERATOR_TYPE_ABSENT - id: 99 - message: "Cannot obtain iterator type in 'for-of' statement." -- name: OBJ_LIT_PROPERTY_REDECLARATION - id: 100 - message: "An object literal cannot have multiple properties with the same name." +- name: DUPLICATE_ACCESSOR + id: 219 + message: "Duplicate accessor definition" -- name: INIT_DOESNT_COMPLETE - id: 101 - message: "Initializer must be able to complete normally." +- name: DUPLICATE_OVERLOADED_NAME + id: 385 + message: "Duplicate overloaded method." + +- name: DUPLICATE_TYPE_PARAM + id: 182 + message: "Duplicate type parameter '{}'." + +- name: DYMANIC_INIT_WITH_OBJEXPR + id: 382 + message: "Dymanic Type {} cannot be initialize with an object expression" + +- name: ENUMB_REFERENCE_VIA_VAR + id: 239 + message: "Cannot refer to enum members through variable." + +- name: ENUM_CONST_MISSING_PROP + id: 240 + message: "Enum constant does not have property '{}'." + +- name: ENUM_INVALID_DISCRIMINANT + id: 162 + message: "Incompatible types. Found: {}, required: char , byte , short , int, long , Char , Byte , Short , Int, Long , String + or an enum type" + +- name: ENUM_NO_SUCH_CONST + id: 241 + message: "No enum constant named '{}' in enum '{}'" + +- name: ENUM_NO_SUCH_METHOD + id: 242 + message: "No enum item method called '{}'" + +- name: ENUM_NO_SUCH_STATIC_METHOD + id: 243 + message: "No enum type method called '{}'" + +- name: ENUM_REFERENCE_VIA_ALIAS + id: 238 + message: "Cannot refer to enum members through type alias." + +- name: ENUM_TYPE_INVALID + id: 35 + message: "Invalid enumeration value type." + +- name: ERROR_ARKTS_NO_DECLARATION_MERGING + id: 341 + message: "Merging declarations is not supported, please keep all definitions of classes, interfaces and enums compact in + the codebase!" + +- name: ERROR_ARKTS_NO_ENUM_MIXED_TYPES + id: 342 + message: "Enumeration members can be initialized only by compile-time expressions and initializers must be of the same type." + +- name: ERROR_ARKTS_NO_LITERAL_INITIALIZATION_WITHOUT_PARAMETERLESS_CONSTRUCTOR + id: 340 + message: "Initialization with literals is not supported if the type has no parameterless constructor. Declare the parameterless + constructor explicitly or remove parametered constructors!" + +- name: ERROR_ARKTS_NO_PROPERTIES_BY_INDEX + id: 343 + message: "Indexed signatures are not allowed. Use arrays instead!" + +- name: EXCEPTION_REDECLARATION + id: 13 + message: "Redeclaration of exception type" + +- name: EXPECTED_TYPE_ARGUMENTS + id: 274 + message: "Expected at least {} type arguments, but got {}." + +- name: EXPORT_INCORRECT + id: 361 + message: "Incorrect export '{}'" + +- name: EXPR_NONCONSTRUCTIBLE + id: 292 + message: "This expression is not constructible." + +- name: EXPR_NOT_CALLABLE + id: 289 + message: "This expression is not callable." + +- name: EXTENDING_FINAL + id: 178 + message: "Cannot inherit with 'final' modifier." + +- name: EXTENDING_STRUCT + id: 177 + message: "struct {} is not extensible." + +- name: EXTENDING_UTILITY_TYPE + id: 176 + message: "The super type of '{}' class is not extensible." + +- name: EXTENDS_NON_OBJECT + id: 185 + message: "Extends constraint must be an object" - name: EXTEND_DYNAMIC id: 102 message: "Class {} shouldn't extend dynamic class." -- name: MISSING_RETURN_STMT - id: 103 - message: "Function with a non void return type must return a value." +- name: EXTENSION_ACCESSOR_INVALID_CALL + id: 59 + message: "Extension accessor can't be used as a method call or function call." -- name: NONRETURNING_PATHS - id: 104 - message: "Not all code paths return a value." +- name: EXTENSION_FUNC_NAME_CONFLICT_WITH_METH + id: 81 + message: "The extension function '{}' has the same name with public method in class {}" -- name: BINOP_INVALID_TYPE - id: 105 - message: "Operator '{}' cannot be applied to types '{}' and '{}'." +- name: EXTENSION_FUNC_ON_INEXETENSIBLE + id: 82 + message: "Extension function can only defined for class, interface or array." -- name: BINOP_ON_UNION - id: 106 - message: "Bad operand type: multiple types left in the normalized union type ({}). Unions are not allowed in binary expressions except equality." +- name: EXTENSION_GETTER_INVALID_CTX + id: 269 + message: "Extension getter in wrong usage" -- name: OP_NONNUMERIC - id: 107 - message: "Bad operand type, the types of the operands must be numeric type." +- name: EXTENSION_NAME_CONFLICT_WITH_FIELD + id: 79 + message: "The extension accessor or extension function '{}' has the same name with field of class {}" -- name: BINOP_NONARITHMETIC_TYPE - id: 108 - message: "Bad operand type, the types of the operands must be numeric type, enum or String." +- name: EXTENSION_NAME_CONFLICT_WITH_METHOD + id: 80 + message: "The extension accessor '{}' has the same name with method in class {}" -- name: BINOP_UNION - id: 109 - message: "Bad operand type, unions are not allowed in binary expressions except equality." +- name: FIELD_ASSIGN_TYPE_MISMATCH + id: 298 + message: "Cannot assign to a {} variable {}" -- name: BINOP_NOT_LOGICAL - id: 110 - message: "Bad operand type, the types of the operands must be of possible condition type." +- name: FIELD_REASSIGNMENT + id: 297 + message: "Cannot reassign {} {}" -- name: BINOP_NOT_REFERENCE - id: 111 - message: "Both operands have to be reference types" +- name: FINAL_METHOD_INVALID_MODIFIER + id: 48 + message: "Invalid method modifier(s): a final method can't have abstract or static modifier." -- name: BINOP_DYN_UNIMPLEMENTED - id: 112 - message: "Unimplemented case in dynamic type comparison." +- name: FIXED_ARRAY_PARAM_ERROR + id: 277 + message: "FixedArray must have only one type parameter." -- name: BINOP_MISMATCHED_ENUMS - id: 113 - message: "Bad operand type, the types of the operands must be the same enum type." +- name: FLOW_REDIRECTION_INVALID_CTX + id: 161 + message: "Control flow redirection statement can not be used out of loop or switch statement." -- name: BINOP_INCOMPARABLE - id: 114 - message: "Bad operand type, the types of the operands must be numeric, same enumeration, or boolean type." +- name: FOROF_CANT_INFER_SOURCE + id: 75 + message: "Cannot determine source expression type in the 'for-of' statement." -- name: BINOP_NOT_SAME - id: 115 - message: "Bad operand type, the types of the operands must be same type." +- name: FOROF_SOURCE_NONITERABLE + id: 76 + message: "'For-of' statement source expression is not of iterable type." -- name: INSTANCEOF_NOT_TYPE - id: 116 - message: "Right-hand side of instanceof expression must represent a type." +- name: FUNCTION_REDECLERATION + id: 160 + message: "Function '{}{}' is redeclared with different signature '{}{}'" -- name: COALESCE_NOT_REF - id: 117 - message: "Left-hand side of nullish-coalescing expression must be a reference type." +- name: FUNCTION_REDECL_BY_ASM_SIG + id: 131 + message: "Function {} with this assembly signature already declared." -- name: BINOP_UNEXPECTED_ERROR - id: 118 - message: "Unexpected type error in binary expression" +- name: FUNCTION_REDECL_BY_TYPE_SIG + id: 130 + message: "Function {} is already declared." -- name: ANALYSIS_ERRORS - id: 119 - message: "There were errors during assign analysis ({})" +- name: FUNCTION_WITHOUT_BODY + id: 17 + message: "Only abstract or native methods can't have body." -- name: INFERENCE_TYPE_INCOMPAT - id: 120 - message: "{} is not compatible with type {}" +- name: FUNC_EXPR_INVALID + id: 16 + message: "Invalid function expression" -- name: SPREAD_ONTO_SINGLE_PARAM - id: 121 - message: "Spread argument cannot be passed for ordinary parameter." +- name: GENERIC_ALIAS_PARAM_COUNT_MISMATCH + id: 157 + message: "Wrong number of type parameters for generic type alias" -- name: ARG_IS_CLASS_ID - id: 122 - message: "Class name can't be the argument of function or method." +- name: GENERIC_ALIAS_WITHOUT_PARAMS + id: 155 + message: "Type alias declaration is generic, but too few type arguments were provided" -- name: MULTIPLE_SPREADS - id: 123 - message: "Spread argument for the rest parameter can be only one." +- name: GENERIC_ERROR_OR_EXCEPTION + id: 214 + message: "Generics are not allowed as '{}' or '{}' subclasses." -- name: PARAM_COUNT_MISMATCH - id: 124 - message: "Expected {} arguments, got {}." +- name: GENERIC_TYPE_PARAM_COUNT_MISMATCH + id: 171 + message: "Type '{}' has {} number of type parameters, but {} type arguments were provided." -- name: NO_SUCH_PARAMLESS_CTOR - id: 125 - message: "No matching parameterless constructor" +- name: GENERIC_WITHOUT_TYPE_PARAMS + id: 170 + message: "Type '{}' is generic but type argument were not provided." -- name: AMBIGUOUS_FUNC_REF - id: 126 - message: "Reference to {} is ambiguous" +- name: GETTER_MISSING_IMPL + id: 188 + message: "{} is not abstract and does not implement getter for {} property in {}" -- name: NO_MATCHING_SIG - id: 127 - message: "No matching {} signature for {}" +- name: GETTER_VOID + id: 86 + message: "Getter must return a value" -- name: NO_MATCHING_SIG_2 - id: 128 - message: "No matching {} signature" +- name: ID_IN_WRONG_CTX + id: 144 + message: "{} name '{}' used in the wrong context" -- name: AMBIGUOUS_CALL_2 - id: 129 - message: "Call to `{}` is ambiguous " +- name: ID_REDECLARED + id: 369 + message: "Identifier '{}' has already been declared." -- name: FUNCTION_REDECL_BY_TYPE_SIG - id: 130 - message: "Function {} is already declared." +- name: ID_WRONG_CTX + id: 330 + message: "Identifier '{}' is used in wrong context." -- name: FUNCTION_REDECL_BY_ASM_SIG - id: 131 - message: "Function {} with this assembly signature already declared." +- name: IFACE_INVALID_EXTENDS + id: 320 + message: "Interface '{}' incorrectly extends interface '{}'" -- name: INFER_FAILURE_FUNC_PARAM - id: 132 - message: "The type of parameter '{}' cannot be inferred" +- name: IFACE_MULTIPLE_EXTENSION + id: 315 + message: "Interface '{}' cannot simultaneously extend types '{}' and '{}'." -- name: MAIN_INVALID_ARG_COUNT - id: 133 - message: "0 or 1 argument are allowed" +- name: ILLEGAL_NON_NULLISH_TYPE + id: 339 + message: "Only type parameters can be used as a nonnullish type" -- name: MAIN_WITH_REST - id: 134 - message: "Rest parameter is not allowed in the 'main' function." +- name: ILLEGAL_UNARY_OP + id: 11 + message: "Illegal unary operator." -- name: MAIN_PARAM_NOT_ARR_OF_STRING - id: 135 - message: "Only 'FixedArray' type argument is allowed." +- name: IMPORTED_NOT_EXPORTED + id: 355 + message: "Imported element not exported '{}'" -- name: OVERRIDE_DOESNT_OVERRIDE - id: 136 - message: "Method {}{} in {} not overriding any method" +- name: IMPORTING_NONEXPORTED_TYPE + id: 354 + message: "Cannot import '{}', imported type imports only exported types." -- name: SIG_UNAVAILABLE - id: 137 - message: "Signature is not available here." +- name: IMPORT_ARG_NOT_STRING + id: 302 + message: "'import' expressions require string as argument." -- name: THIS_OUTSIDE_METHOD_CTX - id: 138 - message: "Cannot reference 'this' in this context." +- name: IMPORT_NOT_FOUND + id: 356 + message: "Cannot find imported element '{}'" -- name: SIG_INVISIBLE - id: 139 - message: "Signature {}{} is not visible here." +- name: IMPORT_NOT_FOUND_2 + id: 360 + message: "Cannot find import: {}" -- name: NO_SUCH_SIG_WITH_TRAILING_LAMBDA - id: 140 - message: "No matching call signature with trailing lambda" +- name: IMPORT_RENAMES_ANNOTATION + id: 357 + message: "Can not rename annotation '{}' in export or import statements." -- name: CANNOT_OVERRIDE - id: 141 - message: "{}{} in {} cannot override {}{} in {} because {}" +- name: INDEX_NEGATIVE_OR_FRACTIONAL + id: 248 + message: "Index value cannot be less than zero or fractional." -- name: AMBIGUOUS_CALL - id: 142 - message: "Call to `{}` is ambiguous as `2` versions of `{}` are available: `{}{}` and `{}{}`" +- name: INDEX_NONINTEGRAL_FLOAT + id: 197 + message: "Index fractional part should be zero." -- name: UNRESOLVED_REF - id: 143 - message: "Unresolved reference {}" +- name: INDEX_ON_INVALID_TYPE + id: 252 + message: "Indexed access is not supported for such expression type." -- name: ID_IN_WRONG_CTX - id: 144 - message: "{} name '{}' used in the wrong context" +- name: INDEX_OOB + id: 249 + message: "Index value cannot be greater than or equal to the array size." -- name: PROP_ACCESS_WITHOUT_THIS - id: 145 - message: "Property '{}' must be accessed through 'this'" +- name: INFERENCE_TYPE_INCOMPAT + id: 120 + message: "{} is not compatible with type {}" -- name: PROPERTY_CAPTURE - id: 146 - message: "Property '{}' of enclosing class '{}' is not allowed to be captured from the local class '{}'" +- name: INFER_FAILURE_FUNC_PARAM + id: 132 + message: "The type of parameter '{}' cannot be inferred" -- name: PROPERTY_CAPTURE_IN_STATIC - id: 147 - message: "Not allowed to capture variable '{}' in static method" +- name: INFER_FAIL_FOR_LAMBDA_SIG + id: 254 + message: "Cannot deduce call signature" -- name: INVALID_EXPR_IN_RETURN - id: 148 - message: "Invalid return statement expression" +- name: INFER_FAIL_ON_LAMBDA + id: 237 + message: "Cannot infer arrow function type from context for type: '{}', consider adding type explicitly" -- name: INVALID_RETURN_FUNC_EXPR - id: 149 - message: "Invalid return function expression" +- name: INFER_FAIL_ON_PARAM + id: 222 + message: "The type of parameter '{}' cannot be inferred." -- name: RETURN_DIFFERENT_PRIM - id: 150 - message: "Function cannot have different primitive return types, require '{}', found '{}'" +- name: INHERITED_CLASS_TYPE_MISMATCH + id: 216 + message: "Cannot inherit from class {}, because {} {} is inherited with a different declaration type" -- name: MEMBER_OF_OBJECT_LIT - id: 151 - message: "Class composite must be constructed separately before referring their members." +- name: INHERITED_INTERFACE_TYPE_MISMATCH + id: 215 + message: "Cannot inherit from interface {} because {} {} is inherited with a different declaration type" -- name: TYPE_MISMATCH_ENUM - id: 152 - message: "Cannot assign type '{}' for variable {}." +- name: INIT_DOESNT_COMPLETE + id: 101 + message: "Initializer must be able to complete normally." - name: INIT_IN_AMBIENT id: 153 message: "Initializers are not allowed in ambient contexts: {}" -- name: AMBIGUOUS_FUNC_INIT - id: 154 - message: "Ambiguous function initialization because of multiple overloads" +- name: INNER_CLASS_MUTABLE_STATIC_PROP + id: 196 + message: "Inner class cannot have non-readonly static properties" -- name: GENERIC_ALIAS_WITHOUT_PARAMS - id: 155 - message: "Type alias declaration is generic, but too few type arguments were provided" +- name: INNER_CLASS_WITH_STATIC_METH + id: 195 + message: "Inner class cannot have static methods" -- name: NON_GENERIC_ALIAS_WITH_PARAMS - id: 156 - message: "Type alias declaration is not generic, but type parameters were provided" +- name: INSTANCEOF_NONOBJECT + id: 296 + message: "Using the 'instance of' operator with non-object type '{}'" -- name: GENERIC_ALIAS_PARAM_COUNT_MISMATCH - id: 157 - message: "Wrong number of type parameters for generic type alias" +- name: INSTANCEOF_NOT_TYPE + id: 116 + message: "Right-hand side of instanceof expression must represent a type." -- name: NAMESPACE_AS_TYPE - id: 158 - message: "Namespace '{}' cannot be used as a type." +- name: INTERFACE_EXTENDS_CLASS + id: 378 + message: "Interfaces cannot extend classes, only other interfaces." -- name: ANNOTATION_AS_TYPE - id: 159 - message: "Annotations cannot be used as a type." +- name: INTERFACE_INSTANTIATION + id: 275 + message: "{} is an interface therefore cannot be instantiated." -- name: FUNCTION_REDECLERATION - id: 160 - message: "Function '{}{}' is redeclared with different signature '{}{}'" +- name: INTERFACE_METHOD_COLLISION + id: 187 + message: "Method '{}' is declared in {} and {} interfaces." -- name: FLOW_REDIRECTION_INVALID_CTX - id: 161 - message: "Control flow redirection statement can not be used out of loop or switch statement." +- name: INTERFACE_PROPERTY_REQUIRES_SETTER + id: 337 + message: "Cannot implement interface {}: property '{}' must have a setter, but the implementation is readonly" + +- name: INTERFACE_PROP_NOT_PUBLIC + id: 217 + message: "Interface property implementation cannot be generated as non-public" -- name: ENUM_INVALID_DISCRIMINANT - id: 162 - message: "Incompatible types. Found: {}, required: char , byte , short , int, long , Char , Byte , Short , Int, Long , String or an enum type" +- name: INTERFACE_REDECLARED + id: 372 + message: "Interface redeclaration is not allowed" -- name: NOT_CONSTANT - id: 163 - message: "Constant expression required" +- name: INTERFACE_WITH_METHOD + id: 256 + message: "Interface has methods" -- name: SWITCH_CASE_INVALID_TYPE - id: 164 - message: "Unexpected type {}" +- name: INVALID_ANNOTATION_RETENTION + id: 3 + message: Annotation '@Retention' can only be applied to annotation declarations. -- name: SWITCH_CASE_DUPLICATE - id: 165 - message: "Case duplicate" +- name: INVALID_ASSIGNMNENT + id: 318 + message: "Type '{}' cannot be assigned to type '{}'" -- name: SWITCH_CASE_VAR_DUPLICATE_VAL - id: 166 - message: "Variable has same value with another switch case" +- name: INVALID_ASSIGNMNENT_2 + id: 321 + message: "Type '{}' is not assignable to type '{}'." -- name: INVALID_TYPE_PARAM - id: 168 - message: "Type '{}' is not valid for generic type arguments" +- name: INVALID_CAPTURE + id: 366 + message: "Cannot capture variable '{}'." -- name: NOT_GENERIC - id: 169 - message: "Type '{}' is not generic." +- name: INVALID_CAST + id: 326 + message: "Cannot cast type '{}' to '{}'" -- name: GENERIC_WITHOUT_TYPE_PARAMS - id: 170 - message: "Type '{}' is generic but type argument were not provided." +- name: INVALID_CONST_ASSIGNMENT + id: 97 + message: "Cannot assign a value to a constant variable {}" -- name: GENERIC_TYPE_PARAM_COUNT_MISMATCH - id: 171 - message: "Type '{}' has {} number of type parameters, but {} type arguments were provided." +- name: INVALID_DOT_CLASS + id: 21 + message: "Invalid .class reference" -- name: NO_STATIC_INVOKE - id: 172 - message: "No static {} method and static {} method in {}. {}() is not allowed." +- name: INVALID_EXPORT + id: 367 + message: "Invalid exported binding" -- name: STATIC_PROP_INVALID_CTX - id: 173 - message: "Static property '{}' must be accessed through it's class '{}'" +- name: INVALID_EXPR_IN_RETURN + id: 148 + message: "Invalid return statement expression" -- name: CANNOT_INFER_OBJ_LIT - id: 174 - message: "Cannot infer type for {} because class composite needs an explicit target type" +- name: INVALID_INDEX_TYPE + id: 236 + message: "Type '{}' cannot be used as an index type. Only primitive or unboxable integral types can be used as index." -- name: AMBIENT_CONST_INVALID_LIT - id: 175 - message: "A 'const' initializer in an ambient context must be a string or numeric literal: {}" +- name: INVALID_LAMBDA_PARAMETER + id: 395 + message: "Invalid lambda parameter. Expected: 'identifier(: type)?', 'identifier?(: type)?' or '...identifier(: type)?'." -- name: EXTENDING_UTILITY_TYPE - id: 176 - message: "The super type of '{}' class is not extensible." +- name: INVALID_READONLY_ASSIGNMENT + id: 98 + message: "Cannot assign a value to a readonly variable {}" -- name: EXTENDING_STRUCT - id: 177 - message: "struct {} is not extensible." +- name: INVALID_RECORD_PROPERTY + id: 393 + message: "Invalid record property" -- name: EXTENDING_FINAL - id: 178 - message: "Cannot inherit with 'final' modifier." +- name: INVALID_RETURN_FUNC_EXPR + id: 149 + message: "Invalid return function expression" -- name: NOT_INTERFACE - id: 179 - message: "Interface expected here." +- name: INVALID_SPREAD_IN_TUPLE + id: 55 + message: "'{}' cannot be spread in tuple." -- name: REPEATED_INTERFACE - id: 180 - message: "Repeated interface." +- name: INVALID_TYPE_PARAM + id: 168 + message: "Type '{}' is not valid for generic type arguments" -- name: CONFLICTING_GENERIC_INTERFACE_IMPLS - id: 181 - message: "Implements generic interface '{}' with different instantiations." +- name: INVALID_TYPE_REF + id: 299 + message: "Invalid type reference." -- name: DUPLICATE_TYPE_PARAM - id: 182 - message: "Duplicate type parameter '{}'." +- name: INVISIBLE_INDEX_ACCESSOR + id: 268 + message: "Index access method is not visible here." -- name: TYPE_PARAM_USE_BEFORE_DEFINE - id: 183 - message: "Type Parameter {} should be defined before use." +- name: INVISIBLE_ITERATOR + id: 272 + message: "Iterator method is not visible here." -- name: TYPE_PARAM_CIRCULAR_CONSTRAINT - id: 184 - message: "Type parameter '{}' has circular constraint dependency." +- name: ITERATOR_DOESNT_RETURN_ITERABLE + id: 261 + message: "Iterator method must return an object which implements Iterator" -- name: EXTENDS_NON_OBJECT - id: 185 - message: "Extends constraint must be an object" +- name: ITERATOR_ELEMENT_TYPE_MISMATCH + id: 69 + message: "Source element type '{}' is not assignable to the loop iterator type '{}'." -- name: ABSTRACT_IS_FINAL - id: 186 - message: "Cannot use both 'final' and 'abstract' modifiers." +- name: ITERATOR_MISSING_NEXT + id: 260 + message: "Iterator object doesn't have proper next method." -- name: INTERFACE_METHOD_COLLISION - id: 187 - message: "Method '{}' is declared in {} and {} interfaces." +- name: ITERATOR_TYPE_ABSENT + id: 99 + message: "Cannot obtain iterator type in 'for-of' statement." -- name: GETTER_MISSING_IMPL - id: 188 - message: "{} is not abstract and does not implement getter for {} property in {}" +- name: KEYOF_REFERENCE_TYPE + id: 276 + message: "The `keyof` keyword can only be used for class or interface type." -- name: SETTER_MISSING_IMPL - id: 189 - message: "{} is not abstract and does not implement setter for {} property in {}" +- name: LATE_INITIALIZATION_FIELD_HAS_INVALID_TYPE + id: 376 + message: "Late-initialized field cannot be nullish types or possibly nullish types." -- name: MISSING_OVERRIDE_OF_ABSTRACT_METH - id: 190 - message: "{} is not abstract and does not override abstract method {}{} in {}" - code_fix_ids: [FixClassNotImplementingInheritedMembers] - name: LOCAL_CLASS_INVALID_CTX id: 191 message: "Local classes must be defined between balanced braces" -- name: CTOR_MISSING_SUPER_CALL - id: 192 - message: "Must call super constructor" +- name: LOCAL_CLASS_NATIVE_METHOD + id: 278 + message: "Local class '{}' shouldn't have native methods/constructors" + +- name: MAIN_BAD_RETURN + id: 88 + message: "Bad return type, main enable only void or int type." + +- name: MAIN_INVALID_ARG_COUNT + id: 133 + message: "0 or 1 argument are allowed" + +- name: MAIN_PARAM_NOT_ARR_OF_STRING + id: 135 + message: "Only 'FixedArray' type argument is allowed." + +- name: MAIN_WITH_REST + id: 134 + message: "Rest parameter is not allowed in the 'main' function." - name: MAYBE_DOUBLE_INIT id: 193 @@ -777,269 +875,224 @@ semantic: id: 194 message: "Variable '{}' might not have been initialized" -- name: INNER_CLASS_WITH_STATIC_METH - id: 195 - message: "Inner class cannot have static methods" - -- name: INNER_CLASS_MUTABLE_STATIC_PROP - id: 196 - message: "Inner class cannot have non-readonly static properties" - -- name: INDEX_NONINTEGRAL_FLOAT - id: 197 - message: "Index fractional part should be zero." - -- name: TUPLE_INDEX_OOB - id: 198 - message: "Element accessor value is out of tuple size bounds." - -- name: TUPLE_INDEX_NONCONST - id: 199 - message: "Only constant expression allowed for element access on tuples." - -- name: TUPLE_INDEX_NOT_INT - id: 200 - message: "Only integer type allowed for element access on tuples." - -- name: CTOR_CLASS_NOT_FIRST - id: 201 - message: "Call to '{}' must be first statement in constructor" - -- name: CTOR_REF_IN_STATIC_CTX - id: 202 - message: "'{}' cannot be referenced from a static context" - -- name: CTOR_REF_INVALID_CTX_GLOBAL - id: 203 - message: "Cannot reference '{}' in this context." - -- name: NO_SUCH_CTOR_SIG - id: 204 - message: "No matching call signature for constructor" - -- name: CATCH_OR_THROW_OF_INVALID_TYPE - id: 205 - message: "Argument must be an instance of '{}' or '{}'" - -- name: NOT_EXPORTED - id: 206 - message: "'{}' is not exported in '{}'" - -- name: PROP_IS_STATIC - id: 207 - message: "'{}' is a static property of '{}'" - -- name: PROP_NOT_STATIC - id: 208 - message: "'{}' is an instance property of '{}'" +- name: MEMBER_OF_OBJECT_LIT + id: 151 + message: "Class composite must be constructed separately before referring their members." -- name: ASSIGN_TO_READONLY_PROP - id: 209 - message: "Cannot assign to this property because it is readonly." +- name: MEMBER_TYPE_MISMATCH_ACROSS_UNION + id: 244 + message: "Member type must be the same for all union objects." -- name: READONLY_FIELD_MULTIPLE_INIT - id: 210 - message: "Readonly field already initialized at declaration." +- name: MERGED_DECLS + id: 370 + message: "Merging declarations is not supported, please keep all definitions of classes, interfaces and enums compact in + the codebase!" -- name: READ_FROM_WRITEONLY_PROP - id: 211 - message: "Cannot read from this property because it is writeonly." +- name: METHOD_ACCESSOR_COLLISION + id: 218 + message: "Method cannot use the same name as {} accessor property" -- name: UNDEFINED_METHOD - id: 212 - message: "Method {} does not exist on this type." +- name: METHOD_ASSIGNMENT + id: 394 + message: "Class methods cannot be overwritten." - name: METHOD_WRONG_CTX id: 213 message: "Method used in wrong context" -- name: GENERIC_ERROR_OR_EXCEPTION - id: 214 - message: "Generics are not allowed as '{}' or '{}' subclasses." +- name: MISSING_EXTENSION_ACCESSOR + id: 246 + message: "Can't find the extension accessor." -- name: INHERITED_INTERFACE_TYPE_MISMATCH - id: 215 - message: "Cannot inherit from interface {} because {} {} is inherited with a different declaration type" +- name: MISSING_INDEX_ACCESSOR_WITH_SIG + id: 251 + message: "Cannot find index access method with the required signature." -- name: INHERITED_CLASS_TYPE_MISMATCH - id: 216 - message: "Cannot inherit from class {}, because {} {} is inherited with a different declaration type" +- name: MISSING_INIT_FOR_PARAM + id: 253 + message: "Expected initializer for parameter {}." -- name: INTERFACE_PROP_NOT_PUBLIC - id: 217 - message: "Interface property implementation cannot be generated as non-public" +- name: MISSING_ITERATOR_METHOD + id: 258 + message: "Object type doesn't have proper iterator method." -- name: METHOD_ACCESSOR_COLLISION - id: 218 - message: "Method cannot use the same name as {} accessor property" +- name: MISSING_ITERATOR_METHOD_WITH_SIG + id: 259 + message: "Cannot find iterator method with the required signature." -- name: DUPLICATE_ACCESSOR - id: 219 - message: "Duplicate accessor definition" +- name: MISSING_OVERRIDE_OF_ABSTRACT_METH + id: 190 + message: "{} is not abstract and does not override abstract method {}{} in {}" + code_fix_ids: [FixClassNotImplementingInheritedMembers] -- name: ACCESSORS_MOD_MISMATCH - id: 220 - message: "Getter and setter methods must have the same accessor modifiers" +- name: MISSING_RETURN_STMT + id: 103 + message: "Function with a non void return type must return a value." -- name: STATIC_METH_IN_CLASS_AND_INTERFACE - id: 221 - message: "Static {} method and static {} method both exist in class/interface {} is not allowed." +- name: MISSING_RETURN_TYPE + id: 18 + message: "Native and Declare methods should have explicit return type." -- name: INFER_FAIL_ON_PARAM - id: 222 - message: "The type of parameter '{}' cannot be inferred." +- name: MISSING_RETURN_TYPE_2 + id: 95 + message: "'{}' doesn't have return type." -- name: UTIL_TYPE_INVALID_TYPE_PARAM_COUNT - id: 223 - message: "Invalid number of type parameters for {} type, should be 1." +- name: MIXED_VOID_NONVOID + id: 92 + message: "All return statements in the function should be empty or have a value." -- name: UTIL_TYPE_OF_NONREFERENCE - id: 224 - message: "Only reference types can be converted to utility types." +- name: MODULE_INDEX_MISSING + id: 359 + message: "Cannot find index.[ets|ts] or package module in folder: {}" -- name: UTILITY_TYPE_UNIMPLEMENTED - id: 225 - message: "This utility type is not yet implemented." +- name: MULTIPLE_DEFAULT_EXPORTS + id: 374 + message: "Only one default export is allowed in a module" -- name: REQUIRED_PROP_MISSING_INIT - id: 226 - message: "Class property '{}' needs to be initialized for Required<{}>." +- name: MULTIPLE_SPREADS + id: 123 + message: "Spread argument for the rest parameter can be only one." -- name: ARRAY_ELEMENT_INIT_TYPE_INCOMPAT - id: 227 - message: "Array element at index {} with type '{}' is not compatible with the target array element type '{}'" +- name: NAMESPACE_AS_TYPE + id: 158 + message: "Namespace '{}' cannot be used as a type." -- name: TYPEARG_TYPEPARAM_SUBTYPING - id: 228 - message: "Type argument '{}' should be a subtype of '{}'-constraint" +- name: NAMESPACE_CALL + id: 295 + message: "Namespace style identifier {} is not callable." -- name: OVERLOADED_FUNCTION_REFERENCE - id: 229 - message: "Overloaded function identifier '{}' can not be used as value" +- name: NATIVE_WITHOUT_RETURN + id: 15 + message: "'Native' method should have explicit return type" -- name: ANNOT_WITHOUT_AT - id: 230 - message: "Annotation missing '@' symbol before annotation name." +- name: NATIVE_WITH_BODY + id: 84 + message: "Native constructor declaration cannot have a body." -- name: TUPLE_WRONG_NUMBER_OF_ELEMS - id: 231 - message: "Initializer has {} elements, but tuple requires {}" +- name: NEGATIVE_INDEX + id: 247 + message: "Index value cannot be less than zero." -- name: ANNOT_IS_VOID - id: 232 - message: "'void' used as type annotation." +- name: NONEXISTENT_TYPE + id: 70 + message: "'{}' type does not exist." -- name: THIS_OR_SUPER_IN_CTOR - id: 235 - message: "Using {} is not allowed in constructor" +- name: NONLITERAL_INSTANTIATION + id: 53 + message: "Required type can be instantiated only with object literal" -- name: INVALID_INDEX_TYPE - id: 236 - message: "Type '{}' cannot be used as an index type. Only primitive or unboxable integral types can be used as index." +- name: NONRETURNING_PATHS + id: 104 + message: "Not all code paths return a value." -- name: INFER_FAIL_ON_LAMBDA - id: 237 - message: "Cannot infer arrow function type from context for type: '{}', consider adding type explicitly" +- name: NON_GENERIC_ALIAS_WITH_PARAMS + id: 156 + message: "Type alias declaration is not generic, but type parameters were provided" -- name: ENUM_REFERENCE_VIA_ALIAS - id: 238 - message: "Cannot refer to enum members through type alias." +- name: NON_SUPERTYPE_OF_UNDEFINED_AS_ARRAY_ELEMENT_TYPE + id: 51 + message: "Cannot use array creation expression with non-constructable element type which is non-assignable from undefined." -- name: ENUMB_REFERENCE_VIA_VAR - id: 239 - message: "Cannot refer to enum members through variable." +- name: NON_VOID_RETURN_IN_CONSTRUCTOR + id: 33 + message: "Return statement with expression isn't allowed in constructor." -- name: ENUM_CONST_MISSING_PROP - id: 240 - message: "Enum constant does not have property '{}'." +- name: NOT_ALLOWED_THIS_IN_ARRAY_TYPE + id: 283 + message: "A 'this' cannot be used as type of array." -- name: ENUM_NO_SUCH_CONST - id: 241 - message: "No enum constant named '{}' in enum '{}'" +- name: NOT_ALLOWED_THIS_IN_TUPLE_TYPE + id: 282 + message: "A 'this' cannot be used as a part of tuple type." -- name: ENUM_NO_SUCH_METHOD - id: 242 - message: "No enum item method called '{}'" +- name: NOT_ALLOWED_THIS_IN_UNION_TYPE + id: 281 + message: "A 'this' cannot be used as a part of union type." -- name: ENUM_NO_SUCH_STATIC_METHOD - id: 243 - message: "No enum type method called '{}'" +- name: NOT_AN_ANNOTATION + id: 67 + message: "'{}' is not an annotation." -- name: MEMBER_TYPE_MISMATCH_ACROSS_UNION - id: 244 - message: "Member type must be the same for all union objects." +- name: NOT_CONSTANT + id: 163 + message: "Constant expression required" -- name: UNION_MEMBER_ILLEGAL_TYPE - id: 245 - message: "Type {} is illegal in union member expression." +- name: NOT_EXPORTED + id: 206 + message: "'{}' is not exported in '{}'" -- name: MISSING_EXTENSION_ACCESSOR - id: 246 - message: "Can't find the extension accessor." +- name: NOT_GENERIC + id: 169 + message: "Type '{}' is not generic." -- name: NEGATIVE_INDEX - id: 247 - message: "Index value cannot be less than zero." +- name: NOT_IMPLEMENTED + id: 368 + message: "not implemented" -- name: INDEX_NEGATIVE_OR_FRACTIONAL - id: 248 - message: "Index value cannot be less than zero or fractional." +- name: NOT_INTERFACE + id: 179 + message: "Interface expected here." -- name: INDEX_OOB - id: 249 - message: "Index value cannot be greater than or equal to the array size." +- name: NO_CALL_SIGNATURE + id: 2 + message: Type '{}' has no call signatures. - name: NO_INDEX_ACCESS_METHOD id: 250 message: "Object type doesn't have proper index access method." -- name: MISSING_INDEX_ACCESSOR_WITH_SIG - id: 251 - message: "Cannot find index access method with the required signature." +- name: NO_MATCHING_SIG + id: 127 + message: "No matching {} signature for {}" -- name: INDEX_ON_INVALID_TYPE - id: 252 - message: "Indexed access is not supported for such expression type." +- name: NO_MATCHING_SIG_2 + id: 128 + message: "No matching {} signature" -- name: MISSING_INIT_FOR_PARAM - id: 253 - message: "Expected initializer for parameter {}." +- name: NO_PARAMLESS_CTOR + id: 291 + message: "Type {} has no parameterless constructor. Initialization with literals is not supported if the type has no parameterless + constructor. Declare the parameterless constructor explicitly or remove parametered constructors!" -- name: INFER_FAIL_FOR_LAMBDA_SIG - id: 254 - message: "Cannot deduce call signature" +- name: NO_STATIC_INVOKE + id: 172 + message: "No static {} method and static {} method in {}. {}() is not allowed." -- name: AMBIGUOUS_UNION_TYPE_OP - id: 255 - message: "Ambiguous union type operation" +- name: NO_SUCH_CTOR_SIG + id: 204 + message: "No matching call signature for constructor" -- name: INTERFACE_WITH_METHOD - id: 256 - message: "Interface has methods" +- name: NO_SUCH_PARAMLESS_CTOR + id: 125 + message: "No matching parameterless constructor" + +- name: NO_SUCH_PARAMLESS_CTOR_2 + id: 270 + message: "No Matching Parameterless Constructor, parameter count {}" -- name: ABSTRACT_METH_IN_ABSTRACT_CLASS - id: 257 - message: "Abstract class has abstract method {}" +- name: NO_SUCH_SIG_WITH_TRAILING_LAMBDA + id: 140 + message: "No matching call signature with trailing lambda" -- name: MISSING_ITERATOR_METHOD - id: 258 - message: "Object type doesn't have proper iterator method." +- name: NULLISH_CAST_TO_NONNULLISH + id: 304 + message: "Cannot cast 'null' or 'undefined' to non-nullish type." -- name: MISSING_ITERATOR_METHOD_WITH_SIG - id: 259 - message: "Cannot find iterator method with the required signature." +- name: OBJECT_LITERAL_METHOD_KEY + id: 74 + message: "Method '{}' cannot be used as a key of object literal." -- name: ITERATOR_MISSING_NEXT - id: 260 - message: "Iterator object doesn't have proper next method." +- name: OBJECT_LITERAL_NOT_KV + id: 64 + message: "The object literal properties must be key-value pairs" -- name: ITERATOR_DOESNT_RETURN_ITERABLE - id: 261 - message: "Iterator method must return an object which implements Iterator" +- name: OBJ_LIT_NOT_COVERING_UNION + id: 265 + message: "All variants of literals listed in the union type must be listed in the object literal" -- name: SWITCH_CASE_TYPE_INCOMPARABLE - id: 262 - message: "Switch case type '{}' is not comparable to discriminant type '{}'" +- name: OBJ_LIT_PROPERTY_REDECLARATION + id: 100 + message: "An object literal cannot have multiple properties with the same name." - name: OBJ_LIT_PROP_NAME_COLLISION id: 263 @@ -1049,521 +1102,491 @@ semantic: id: 264 message: "Object literal may only specify known properties" -- name: OBJ_LIT_NOT_COVERING_UNION - id: 265 - message: "All variants of literals listed in the union type must be listed in the object literal" +- name: OPERAND_NOT_NUMERIC + id: 66 + message: "Bad operand type, the type of the operand must be numeric type." -- name: PRECOND_FAILED - id: 266 - message: "Precondition check failed for {}" +- name: OP_NONNUMERIC + id: 107 + message: "Bad operand type, the types of the operands must be numeric type." -- name: POSTCOND_FAILED - id: 267 - message: "Postcondition check failed for {}" +- name: OVERLOADED_FUNCTION_REFERENCE + id: 229 + message: "Overloaded function identifier '{}' can not be used as value" -- name: INVISIBLE_INDEX_ACCESSOR - id: 268 - message: "Index access method is not visible here." +- name: OVERLOADED_MAIN + id: 373 + message: "Main overload is not enabled" -- name: EXTENSION_GETTER_INVALID_CTX - id: 269 - message: "Extension getter in wrong usage" +- name: OVERLOADED_METHOD_AS_VALUE + id: 307 + message: "Overloaded method is used as value" -- name: NO_SUCH_PARAMLESS_CTOR_2 - id: 270 - message: "No Matching Parameterless Constructor, parameter count {}" +- name: OVERLOADED_NAME_MUST_ALSO_EXPORTED + id: 390 + message: "Overload alias is exported, then overload functions must also be exported." -- name: INVISIBLE_ITERATOR - id: 272 - message: "Iterator method is not visible here." +- name: OVERLOADED_NAME_MUST_FUNCTION + id: 384 + message: "overloaded name must refer to an accessible method." -- name: RTYPE_PARAM_COUNT_MISMATCH - id: 273 - message: "Expected {} type arguments, got {} ." +- name: OVERLOADED_NAME_REFER_TO_OVERLOAD_FUNCTION + id: 389 + message: "The overloaded name '{}' can't refer to a function with overload signatures." -- name: EXPECTED_TYPE_ARGUMENTS - id: 274 - message: "Expected at least {} type arguments, but got {}." +- name: OVERLOADED_UNION_CALL + id: 391 + message: "Overload declaration cannot be called by union." -- name: INTERFACE_INSTANTIATION - id: 275 - message: "{} is an interface therefore cannot be instantiated." +- name: OVERLOAD_MODIFIERS_ABSTRACT + id: 392 + message: "overload declaration cannot contain abstract methods." -- name: KEYOF_REFERENCE_TYPE - id: 276 - message: "The `keyof` keyword can only be used for class or interface type." +- name: OVERLOAD_MUST_BOTH_CONSTRUCT + id: 388 + message: "The overload alias and the overloaded method must either both be constructors or both be non-constructors." -- name: FIXED_ARRAY_PARAM_ERROR - id: 277 - message: "FixedArray must have only one type parameter." +- name: OVERLOAD_NAME_MUST_BE_IDENTIFIER + id: 383 + message: "The name of overload declaration should be an identifier." -- name: LOCAL_CLASS_NATIVE_METHOD - id: 278 - message: "Local class '{}' shouldn't have native methods/constructors" +- name: OVERLOAD_SAME_ACCESS_MODIFIERS + id: 386 + message: "Overload alias and overloaded method name must have exactly the same modifiers (public, private, protected)." -- name: TUPLEN_NOT_IMPLEMENTED - id: 279 - message: "Tuple types with arity >16 are not yet implemented" +- name: OVERLOAD_SAME_ACCESS_MODIFIERS_STATIC_ASYNC + id: 387 + message: "Overload alias and overloaded method name must have exactly the same modifiers (static, async)." -- name: PROPERTY_MAYBE_MISSING_INIT - id: 280 - message: "Property '{}' might not have been initialized." +- name: OVERRIDE_DOESNT_OVERRIDE + id: 136 + message: "Method {}{} in {} not overriding any method" -- name: NOT_ALLOWED_THIS_IN_UNION_TYPE - id: 281 - message: "A 'this' cannot be used as a part of union type." +- name: PARAM_COUNT_MISMATCH + id: 124 + message: "Expected {} arguments, got {}." -- name: NOT_ALLOWED_THIS_IN_TUPLE_TYPE - id: 282 - message: "A 'this' cannot be used as a part of tuple type." +- name: POSSIBLY_NULLISH + id: 10 + message: "Value is possibly nullish." -- name: NOT_ALLOWED_THIS_IN_ARRAY_TYPE - id: 283 - message: "A 'this' cannot be used as type of array." +- name: POSTCOND_FAILED + id: 267 + message: "Postcondition check failed for {}" -- name: TYPE_FROM_UNION_TYPE_UNSUPPORTED - id: 284 - message: "Acquiring types for union types is not supported." +- name: PRECOND_FAILED + id: 266 + message: "Precondition check failed for {}" -- name: TYPE_FROM_UNRESOLVABLE_TYPE - id: 285 - message: "Unable to resolve type." +- name: PRIVATE_METHOD_AS_VALUE + id: 306 + message: "Private method is used as value" -- name: TYPE_FROM_TUPLE_TYPE_UNSUPPORTED - id: 286 - message: "Acquiring types for tuple types is not supported." +- name: PROPERTY_CAPTURE + id: 146 + message: "Property '{}' of enclosing class '{}' is not allowed to be captured from the local class '{}'" -- name: TYPE_FROM_STRING_LITERAL_TYPE_UNSUPPORTED - id: 287 - message: "Acquiring types for string literal types is not supported." +- name: PROPERTY_CAPTURE_IN_STATIC + id: 147 + message: "Not allowed to capture variable '{}' in static method" -- name: STATIC_REF_TO_NONSTATIC - id: 288 - message: "Cannot make a static reference to the non-static type {}" +- name: PROPERTY_MAYBE_MISSING_INIT + id: 280 + message: "Property '{}' might not have been initialized." -- name: EXPR_NOT_CALLABLE - id: 289 - message: "This expression is not callable." +- name: PROPERTY_NONEXISTENT + id: 87 + message: "Property '{}' does not exist on type '{}'" -- name: CALLEE_NONCONSTRUCTIBLE - id: 290 - message: "Type '{}' is not constructible." +- name: PROP_ACCESS_WITHOUT_THIS + id: 145 + message: "Property '{}' must be accessed through 'this'" -- name: NO_PARAMLESS_CTOR - id: 291 - message: "Type {} has no parameterless constructor. Initialization with literals is not supported if the type has no parameterless constructor. Declare the parameterless constructor explicitly or remove parametered constructors!" +- name: PROP_ASSIGN_TO_NUMERIC_INDEX + id: 324 + message: "Property '{}' of type '{}' is not assignable to numeric index type '{}'." -- name: EXPR_NONCONSTRUCTIBLE - id: 292 - message: "This expression is not constructible." +- name: PROP_ASSIGN_TO_STRING_INDEX + id: 327 + message: "Property '{}' of type '{}' is not assignable to string index type '{}'." + +- name: PROP_INCOMPAT + id: 319 + message: "Type '{}' is not compatible with type '{}' at property '{}'" - name: PROP_INVISIBLE id: 293 message: "Property {} is not visible here." -- name: CLASS_OR_IFACE_AS_OBJ - id: 294 - message: "Class or interface '{}' cannot be used as object" - -- name: NAMESPACE_CALL - id: 295 - message: "Namespace style identifier {} is not callable." - -- name: INSTANCEOF_NONOBJECT - id: 296 - message: "Using the 'instance of' operator with non-object type '{}'" - -- name: FIELD_REASSIGNMENT - id: 297 - message: "Cannot reassign {} {}" - -- name: FIELD_ASSIGN_TYPE_MISMATCH - id: 298 - message: "Cannot assign to a {} variable {}" - -- name: INVALID_TYPE_REF - id: 299 - message: "Invalid type reference." - -- name: UNION_NONCONSTRUCTIBLE - id: 300 - message: "The union type is not constructible." - -- name: UNRESOLVABLE_ARRAY - id: 301 - message: "Can't resolve array type" - -- name: IMPORT_ARG_NOT_STRING - id: 302 - message: "'import' expressions require string as argument." +- name: PROP_IS_STATIC + id: 207 + message: "'{}' is a static property of '{}'" -- name: AWAITED_NOT_PROMISE - id: 303 - message: "'await' expressions require Promise object as argument." +- name: PROP_NOT_STATIC + id: 208 + message: "'{}' is an instance property of '{}'" -- name: NULLISH_CAST_TO_NONNULLISH - id: 304 - message: "Cannot cast 'null' or 'undefined' to non-nullish type." +- name: READONLY_ARRAYLIKE_MODIFICATION + id: 58 + message: "Cannot modify an array or tuple content that has the readonly parameter" -- name: CAST_TO_NEVER - id: 305 - message: "Cast to 'never' is prohibited" +- name: READONLY_CALL + id: 27 + message: "Cannot call readonly type methods." -- name: PRIVATE_METHOD_AS_VALUE - id: 306 - message: "Private method is used as value" +- name: READONLY_FIELD_MULTIPLE_INIT + id: 210 + message: "Readonly field already initialized at declaration." -- name: OVERLOADED_METHOD_AS_VALUE - id: 307 - message: "Overloaded method is used as value" +- name: READONLY_PROPERTY_REASSIGN + id: 338 + message: "The 'Readonly' property cannot be reassigned." -- name: CIRCULAR_DEPENDENCY - id: 308 - message: "Circular dependency detected for identifier: {}" +- name: READ_FROM_WRITEONLY_PROP + id: 211 + message: "Cannot read from this property because it is writeonly." - name: RECURSIVE_CTOR id: 309 message: "Recursive constructor invocation" -- name: CYCLIC_INHERITANCE - id: 310 - message: "Cyclic inheritance involving {}." - -- name: CYCLIC_ALIAS - id: 311 - message: "Circular type alias reference" - - name: RECURSIVE_EXTENSION id: 312 message: "Type {} recursively references itself as a base type." -- name: CYCLIC_ALIAS_2 - id: 313 - message: "Type alias {} circularly refences itself" +- name: REDEFINITION + id: 349 + message: "{} '{}' is already defined." -- name: CYCLIC_VAR_REF - id: 314 - message: "'{}' is referenced directly or indirectly in its own initializer ot type annotation." +- name: REDEFINITION_DIFF_TYPE + id: 350 + message: "{} '{}' is already defined with different type." -- name: IFACE_MULTIPLE_EXTENSION - id: 315 - message: "Interface '{}' cannot simultaneously extend types '{}' and '{}'." +- name: REF_INVALID + id: 329 + message: "Invalid reference '{}'." -- name: DIFFERENT_SUBSEQ_DECL - id: 316 - message: "Subsequent variable declaration must have the same type. Variable '{}' must be of type '{}', but here has type '{}'." +- name: REPEATED_INTERFACE + id: 180 + message: "Repeated interface." -- name: DIFFERENT_SUBSEQ_PROP_DECL - id: 317 - message: "Subsequent variable declaration must have the same type. Variable '{}' must be of type '{}', but here has type '{}'." +- name: REQUIRED_PROP_MISSING_INIT + id: 226 + message: "Class property '{}' needs to be initialized for Required<{}>." -- name: INVALID_ASSIGNMNENT - id: 318 - message: "Type '{}' cannot be assigned to type '{}'" +- name: REST_PARAM_INCOMPAT_AT + id: 323 + message: "Type '{}' is not compatible with rest parameter type '{}' at index {}" -- name: PROP_INCOMPAT - id: 319 - message: "Type '{}' is not compatible with type '{}' at property '{}'" +- name: RETURN_DIFFERENT_PRIM + id: 150 + message: "Function cannot have different primitive return types, require '{}', found '{}'" -- name: IFACE_INVALID_EXTENDS - id: 320 - message: "Interface '{}' incorrectly extends interface '{}'" +- name: RETURN_ISNT_ITERATOR + id: 96 + message: "The return type of '{}' must be a type that implements Iterator interface." -- name: INVALID_ASSIGNMNENT_2 - id: 321 - message: "Type '{}' is not assignable to type '{}'." +- name: RETURN_THIS_OUTSIDE_METHOD + id: 31 + message: "Only extension function or a class method can return 'this'" -- name: DISJOINT_CONVERSION - id: 322 - message: "Conversion of type '{}' to type '{}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first." +- name: RETURN_TYPE_MISMATCH + id: 90 + message: "Return statement type is not compatible with the enclosing method's return type." -- name: REST_PARAM_INCOMPAT_AT - id: 323 - message: "Type '{}' is not compatible with rest parameter type '{}' at index {}" +- name: RETURN_WITHOUT_VALUE + id: 32 + message: "Missing return value." -- name: PROP_ASSIGN_TO_NUMERIC_INDEX - id: 324 - message: "Property '{}' of type '{}' is not assignable to numeric index type '{}'." +- name: RTYPE_PARAM_COUNT_MISMATCH + id: 273 + message: "Expected {} type arguments, got {} ." -- name: TUPLE_CONVERSION_FAILURE - id: 325 - message: "Tuple type couldn't be converted " +- name: SETTER_MISSING_IMPL + id: 189 + message: "{} is not abstract and does not implement setter for {} property in {}" -- name: INVALID_CAST - id: 326 - message: "Cannot cast type '{}' to '{}'" +- name: SETTER_NONVOID + id: 85 + message: "Setter must have void return type" -- name: PROP_ASSIGN_TO_STRING_INDEX - id: 327 - message: "Property '{}' of type '{}' is not assignable to string index type '{}'." +- name: SIG_INVISIBLE + id: 139 + message: "Signature {}{} is not visible here." -- name: UNIMPLEMENTED_REST_TUPLE - id: 328 - message: "Tuple types for rest arguments are not yet implemented" +- name: SIG_UNAVAILABLE + id: 137 + message: "Signature is not available here." -- name: REF_INVALID - id: 329 - message: "Invalid reference '{}'." +- name: SPREAD_OF_INVALID_TYPE + id: 49 + message: "Spread expression can be applied only to array or tuple type, but '{}' is provided" -- name: ID_WRONG_CTX - id: 330 - message: "Identifier '{}' is used in wrong context." +- name: SPREAD_ONTO_SINGLE_PARAM + id: 121 + message: "Spread argument cannot be passed for ordinary parameter." -- name: VARIANT_PARAM_INVARIAN_USE - id: 331 - message: "Type Parameter '{}' is declared as{} but occurs in 'invariant' position." +- name: STANDARD_ANNOTATION_REQUIRED + id: 6 + message: Only standard annotations are allowed to be applied on annotations. -- name: VARIANCE_TPARAM_IN_OUT - id: 332 - message: "Type Parameter '{}' is declared as 'in' but occurs in 'out' position." +- name: STATIC_INIT_IN_NESTED_CLASS + id: 14 + message: "Static initializer is not allowed in inner class." -- name: VARIANCE_TPARAM_OUT_IN - id: 333 - message: "Type Parameter '{}' is declared as 'out' but occurs in 'in' position." +- name: STATIC_METHOD_INVALID_MODIFIER + id: 77 + message: "Invalid method modifier(s): a static method can't have abstract, final or override modifier." -- name: SWITCH_ENUM_NOT_UNQUALIFIED_ENUM_CONST - id: 334 - message: "Enum switch case must be unqualified name of an enum constant" +- name: STATIC_METH_IN_CLASS_AND_INTERFACE + id: 221 + message: "Static {} method and static {} method both exist in class/interface {} is not allowed." + +- name: STATIC_PROP_INVALID_CTX + id: 173 + message: "Static property '{}' must be accessed through it's class '{}'" + +- name: STATIC_REF_TO_NONSTATIC + id: 288 + message: "Cannot make a static reference to the non-static type {}" - name: STATIC_UNION id: 335 message: "Static union member expression cannot be interpreted." -- name: CAST_FAIL_UNREACHABLE - id: 336 - message: "this cast should never fail" +- name: SUPER_NOT_ACCESSIBLE + id: 377 + message: "Class field '{}' defined by the parent class is not accessible in the child class via super." -- name: INTERFACE_PROPERTY_REQUIRES_SETTER - id: 337 - message: "Cannot implement interface {}: property '{}' must have a setter, but the implementation is readonly" +- name: SWITCH_CASE_DUPLICATE + id: 165 + message: "Case duplicate" -- name: READONLY_PROPERTY_REASSIGN - id: 338 - message: "The 'Readonly' property cannot be reassigned." +- name: SWITCH_CASE_INVALID_TYPE + id: 164 + message: "Unexpected type {}" -- name: ILLEGAL_NON_NULLISH_TYPE - id: 339 - message: "Only type parameters can be used as a nonnullish type" +- name: SWITCH_CASE_TYPE_INCOMPARABLE + id: 262 + message: "Switch case type '{}' is not comparable to discriminant type '{}'" -- name: ERROR_ARKTS_NO_LITERAL_INITIALIZATION_WITHOUT_PARAMETERLESS_CONSTRUCTOR - id: 340 - message: "Initialization with literals is not supported if the type has no parameterless constructor. Declare the parameterless constructor explicitly or remove parametered constructors!" +- name: SWITCH_CASE_VAR_DUPLICATE_VAL + id: 166 + message: "Variable has same value with another switch case" -- name: ERROR_ARKTS_NO_DECLARATION_MERGING - id: 341 - message: "Merging declarations is not supported, please keep all definitions of classes, interfaces and enums compact in the codebase!" +- name: SWITCH_ENUM_NOT_UNQUALIFIED_ENUM_CONST + id: 334 + message: "Enum switch case must be unqualified name of an enum constant" -- name: ERROR_ARKTS_NO_ENUM_MIXED_TYPES - id: 342 - message: "Enumeration members can be initialized only by compile-time expressions and initializers must be of the same type." +- name: TEMPLATE_COUNT_MISMATCH + id: 28 + message: "Invalid string template expression" -- name: ERROR_ARKTS_NO_PROPERTIES_BY_INDEX - id: 343 - message: "Indexed signatures are not allowed. Use arrays instead!" +- name: TEMPORAL_DEADZONE + id: 365 + message: "Variable '{}' is accessed before it's initialization." -- name: CONSTANT_FLOATING_POINT_COVERSION - id: 344 - message: "Floating-point value cannot be converted" +- name: THIS_OR_SUPER_IN_CTOR + id: 235 + message: "Using {} is not allowed in constructor" -- name: CONSTANT_VALUE_OUT_OF_RANGE - id: 345 - message: "Value is out of range" +- name: THIS_OUTSIDE_METHOD_CTX + id: 138 + message: "Cannot reference 'this' in this context." -- name: WRONG_OPERAND_TYPE_FOR_BINARY_EXPRESSION - id: 346 - message: "Wrong type of operands for binary expression" +- name: TUPLEN_NOT_IMPLEMENTED + id: 279 + message: "Tuple types with arity >16 are not yet implemented" -- name: WRONG_OPERAND_TYPE_FOR_UNARY_EXPRESSION - id: 347 - message: "Wrong operand type for unary expression" +- name: TUPLE_CONVERSION_FAILURE + id: 325 + message: "Tuple type couldn't be converted " + +- name: TUPLE_INDEX_NONCONST + id: 199 + message: "Only constant expression allowed for element access on tuples." + +- name: TUPLE_INDEX_NOT_INT + id: 200 + message: "Only integer type allowed for element access on tuples." + +- name: TUPLE_INDEX_OOB + id: 198 + message: "Element accessor value is out of tuple size bounds." + +- name: TUPLE_SIZE_MISMATCH + id: 56 + message: "Too many elements in array initializer for tuple with size of {}" + +- name: TUPLE_UNASSIGNABLE_ARRAY + id: 57 + message: "Array initializer's type is not assignable to tuple type at index: {}" + +- name: TUPLE_WRONG_NUMBER_OF_ELEMS + id: 231 + message: "Initializer has {} elements, but tuple requires {}" -- name: UNION_METHOD_SIGNATURE - id: 348 - message: "Union constituent types should have only one common method signature." +- name: TYPEARG_TYPEPARAM_SUBTYPING + id: 228 + message: "Type argument '{}' should be a subtype of '{}'-constraint" -- name: REDEFINITION - id: 349 - message: "{} '{}' is already defined." +- name: TYPE_FROM_STRING_LITERAL_TYPE_UNSUPPORTED + id: 287 + message: "Acquiring types for string literal types is not supported." -- name: REDEFINITION_DIFF_TYPE - id: 350 - message: "{} '{}' is already defined with different type." +- name: TYPE_FROM_TUPLE_TYPE_UNSUPPORTED + id: 286 + message: "Acquiring types for tuple types is not supported." -- name: VARIABLE_REDECLARED - id: 351 - message: "Variable '{}' has already been declared." +- name: TYPE_FROM_UNION_TYPE_UNSUPPORTED + id: 284 + message: "Acquiring types for union types is not supported." -- name: DEFAULT_DYNAMIC_IMPORT - id: 352 - message: "Default import is currently not implemented in dynamic import" +- name: TYPE_FROM_UNRESOLVABLE_TYPE + id: 285 + message: "Unable to resolve type." -- name: DEFAULT_EXPORT_DIRECT_IMPORTED - id: 353 - message: "Use the default import syntax to import a default exported element" +- name: TYPE_MISMATCH_AT_IDX + id: 46 + message: "Type '{}' is not compatible with type '{}' at index {}" -- name: IMPORTING_NONEXPORTED_TYPE - id: 354 - message: "Cannot import '{}', imported type imports only exported types." +- name: TYPE_MISMATCH_ENUM + id: 152 + message: "Cannot assign type '{}' for variable {}." -- name: IMPORTED_NOT_EXPORTED - id: 355 - message: "Imported element not exported '{}'" +- name: TYPE_NOT_FOUND + id: 371 + message: "Cannot find type '{}'." -- name: IMPORT_NOT_FOUND - id: 356 - message: "Cannot find imported element '{}'" +- name: TYPE_PARAMETER_AS_ARRAY_ELEMENT_TYPE + id: 7 + message: Cannot use array creation expression with type parameter. -- name: IMPORT_RENAMES_ANNOTATION - id: 357 - message: "Can not rename annotation '{}' in export or import statements." +- name: TYPE_PARAM_CIRCULAR_CONSTRAINT + id: 184 + message: "Type parameter '{}' has circular constraint dependency." -- name: DEFAULT_IMPORT_NOT_FOUND - id: 358 - message: "Cannot find default imported element in the target" +- name: TYPE_PARAM_USE_BEFORE_DEFINE + id: 183 + message: "Type Parameter {} should be defined before use." -- name: MODULE_INDEX_MISSING - id: 359 - message: "Cannot find index.[ets|ts] or package module in folder: {}" +- name: UNCALLABLE_TYPE + id: 60 + message: "Type '{}' has no call signatures." -- name: IMPORT_NOT_FOUND_2 - id: 360 - message: "Cannot find import: {}" +- name: UNDEFINED_METHOD + id: 212 + message: "Method {} does not exist on this type." -- name: EXPORT_INCORRECT - id: 361 - message: "Incorrect export '{}'" +- name: UNDEFINED_PROPERTY + id: 65 + message: "type {} has no property named {}" -- name: AMBIGUOUS_EXPORT - id: 362 - message: "Ambiguous export '{}'" +- name: UNEXPECTED_ARRAY + id: 72 + message: "Expected type for array literal should be an array type, got {}" -- name: CONST_WITHOUT_INIT - id: 363 - message: "Missing initializer in const declaration" +- name: UNEXPECTED_FUNC_BODY + id: 83 + message: "Native, Abstract and Declare methods cannot have body." + +- name: UNEXPECTED_NONVOID + id: 94 + message: "'{}' should have void return type." - name: UNEXPECTED_STRUCT id: 364 message: "Structs are only used to define UI components, it should be translated at 'plugin after parser' phase." -- name: TEMPORAL_DEADZONE - id: 365 - message: "Variable '{}' is accessed before it's initialization." - -- name: INVALID_CAPTURE - id: 366 - message: "Cannot capture variable '{}'." +- name: UNEXPECTED_VALUE_RETURN + id: 89 + message: "Unexpected return value, enclosing method return type is void." -- name: INVALID_EXPORT - id: 367 - message: "Invalid exported binding" +- name: UNEXPECTED_VOID + id: 93 + message: "'{}' shouldn't have void return type." -- name: NOT_IMPLEMENTED - id: 368 - message: "not implemented" +- name: UNIMPLEMENTED_REST_TUPLE + id: 328 + message: "Tuple types for rest arguments are not yet implemented" -- name: ID_REDECLARED - id: 369 - message: "Identifier '{}' has already been declared." +- name: UNION_MEMBER_ILLEGAL_TYPE + id: 245 + message: "Type {} is illegal in union member expression." -- name: MERGED_DECLS - id: 370 - message: "Merging declarations is not supported, please keep all definitions of classes, interfaces and enums compact in the codebase!" +- name: UNION_METHOD_SIGNATURE + id: 348 + message: "Union constituent types should have only one common method signature." -- name: TYPE_NOT_FOUND - id: 371 - message: "Cannot find type '{}'." +- name: UNION_NONCONSTRUCTIBLE + id: 300 + message: "The union type is not constructible." -- name: INTERFACE_REDECLARED - id: 372 - message: "Interface redeclaration is not allowed" +- name: UNRESOLVABLE_ARRAY + id: 301 + message: "Can't resolve array type" -- name: OVERLOADED_MAIN - id: 373 - message: "Main overload is not enabled" +- name: UNRESOLVED_REF + id: 143 + message: "Unresolved reference {}" -- name: MULTIPLE_DEFAULT_EXPORTS - id: 374 - message: "Only one default export is allowed in a module" +- name: UNSUPPORTED_CLASS_LITERAL + id: 20 + message: "Class literal is not yet supported." - name: USE_BEFORE_INIT id: 375 message: "{} '{}' is used before being assigned." -- name: LATE_INITIALIZATION_FIELD_HAS_INVALID_TYPE - id: 376 - message: "Late-initialized field cannot be nullish types or possibly nullish types." - -- name: SUPER_NOT_ACCESSIBLE - id: 377 - message: "Class field '{}' defined by the parent class is not accessible in the child class via super." - -- name: INTERFACE_EXTENDS_CLASS - id: 378 - message: "Interfaces cannot extend classes, only other interfaces." -- name: CYCLIC_TYPE_OF - id: 379 - message: "Circular type of reference" - -- name: CYCLIC_CLASS_SUPER_TYPE - id: 380 - message: "Class's super type is itself" - -- name: CYCLIC_CALLEE - id: 381 - message: "Circular call function" - -- name: DYMANIC_INIT_WITH_OBJEXPR - id: 382 - message: "Dymanic Type {} cannot be initialize with an object expression" - -- name: OVERLOAD_NAME_MUST_BE_IDENTIFIER - id: 383 - message: "The name of overload declaration should be an identifier." +- name: UTILITY_TYPE_UNIMPLEMENTED + id: 225 + message: "This utility type is not yet implemented." -- name: OVERLOADED_NAME_MUST_FUNCTION - id: 384 - message: "overloaded name must refer to an accessible method." +- name: UTIL_TYPE_INVALID_TYPE_PARAM_COUNT + id: 223 + message: "Invalid number of type parameters for {} type, should be 1." -- name: DUPLICATE_OVERLOADED_NAME - id: 385 - message: "Duplicate overloaded method." +- name: UTIL_TYPE_OF_NONREFERENCE + id: 224 + message: "Only reference types can be converted to utility types." -- name: OVERLOAD_SAME_ACCESS_MODIFIERS - id: 386 - message: "Overload alias and overloaded method name must have exactly the same modifiers (public, private, protected)." +- name: VARIABLE_REDECLARED + id: 351 + message: "Variable '{}' has already been declared." -- name: OVERLOAD_SAME_ACCESS_MODIFIERS_STATIC_ASYNC - id: 387 - message: "Overload alias and overloaded method name must have exactly the same modifiers (static, async)." +- name: VARIANCE_TPARAM_IN_OUT + id: 332 + message: "Type Parameter '{}' is declared as 'in' but occurs in 'out' position." -- name: OVERLOAD_MUST_BOTH_CONSTRUCT - id: 388 - message: "The overload alias and the overloaded method must either both be constructors or both be non-constructors." +- name: VARIANCE_TPARAM_OUT_IN + id: 333 + message: "Type Parameter '{}' is declared as 'out' but occurs in 'in' position." -- name: OVERLOADED_NAME_REFER_TO_OVERLOAD_FUNCTION - id: 389 - message: "The overloaded name '{}' can't refer to a function with overload signatures." +- name: VARIANT_PARAM_INVARIAN_USE + id: 331 + message: "Type Parameter '{}' is declared as{} but occurs in 'invariant' position." -- name: OVERLOADED_NAME_MUST_ALSO_EXPORTED - id: 390 - message: "Overload alias is exported, then overload functions must also be exported." +- name: VOID_IN_LOGIC + id: 9 + message: "An expression of type 'void' cannot be tested for truthiness" -- name: OVERLOADED_UNION_CALL - id: 391 - message: "Overload declaration cannot be called by union." +- name: VOID_VALUE + id: 78 + message: "Cannot use type 'void' as value. " -- name: OVERLOAD_MODIFIERS_ABSTRACT - id: 392 - message: "overload declaration cannot contain abstract methods." - -- name: INVALID_RECORD_PROPERTY - id: 393 - message: "Invalid record property" +- name: WRONG_OPERAND_TYPE_FOR_BINARY_EXPRESSION + id: 346 + message: "Wrong type of operands for binary expression" -- name: METHOD_ASSIGNMENT - id: 394 - message: "Class methods cannot be overwritten." +- name: WRONG_OPERAND_TYPE_FOR_UNARY_EXPRESSION + id: 347 + message: "Wrong operand type for unary expression" -- name: INVALID_LAMBDA_PARAMETER - id: 395 - message: "Invalid lambda parameter. Expected: 'identifier(: type)?', 'identifier?(: type)?' or '...identifier(: type)?'." +graveyard: +- 8 +- 29 +- 167 +- 233 +- 234 +- 271 +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/util/diagnostic/syntax.yaml b/ets2panda/util/diagnostic/syntax.yaml index 87fa64579b..47d782ae57 100644 --- a/ets2panda/util/diagnostic/syntax.yaml +++ b/ets2panda/util/diagnostic/syntax.yaml @@ -12,1306 +12,1316 @@ # limitations under the License. syntax: -- name: MISSING_TYPE_ANNOTATION - id: 1 - message: "Missing type annotation for property '{}'." -- name: DIFFERENT_PACKAGE_NAME - id: 2 - message: "Files '{}' and '{}' are in the same folder, but have different package names." +- name: ABSTRACT_METHODS_ONLY_IN_ABSTRACT_CLASS + id: 184 + message: "Abstract methods can only appear within an abstract class." -- name: PACKAGE_MODULE_IMPORT_OWN_PACKAGE - id: 3 - message: "Package module cannot import from a file in it's own package." +- name: ABSTRACT_METHOD_ASYNC + id: 118 + message: "Abstract method cannot be async." + +- name: ACCESS_BEFORE_FIELD_METHOD + id: 120 + message: "Access modifier must precede field and method modifiers." + +- name: ALREADY_EXPORTED + id: 282 + message: "Cannot export '{}', it was already exported." - name: AMBIENT_CLASS_MISSING_BODY id: 4 message: "Ambient class declarations must have a body." -- name: EXPORT_DEFAULT_WITH_MUPLTIPLE_SPECIFIER - id: 5 - message: "export default is not allowed to export multiple specifiers." - -- name: NAMESPACE_MERGE_ERROR - id: 6 - message: "Unable to merge namespaces '{}', because their modifiers are different." +- name: ANNOTATION_ABSTRACT + id: 29 + message: "Annotations are not allowed on an abstract class or methods." -- name: NAMESPACE_ANNOTATION_CONFLICT - id: 7 - message: "Annotation conflict! Multiple namespace declarations for '{}' cannot each have annotations." +- name: ANNOTATION_DECLARATION_ACCESS_MODIFIER + id: 210 + message: "Annotation declaration can not have access modifier." -- name: INVALID_NODE_NUMBER - id: 8 - message: "Invalid node number in format expression." +- name: ANNOTATION_METHOD_AS_PROP + id: 25 + message: "Annotation can not have method as property." -- name: INVALID_NODE_TYPE - id: 9 - message: "Invalid node type in format expression." +- name: ANNOTATION_NOT_ALLOWED + id: 113 + message: "Annotations cannot be applied here." -- name: INSERT_NODE_ABSENT - id: 10 - message: "There is no any node to insert at the placeholder position." +- name: ANNOTATION_ONLY_TOP_LEVEL + id: 114 + message: "Annotations can only be declared at the top level." -- name: INVALID_INSERT_NODE - id: 11 - message: "Inserting node type differs from that required by format specification." +- name: ANNOTATION_PROPERTY_ACCESS_MODIFIERS + id: 24 + message: "Annotation property can not have access modifiers." -- name: INVALID_CLASS_FIELD - id: 12 - message: "Cannot parse class field definition property." +- name: ANNOTATION_WRONG_DEC + id: 28 + message: "Annotations are not allowed on this type of declaration." -- name: INVALID_CLASS_METHOD - id: 13 - message: "Cannot parse class method definition property." +- name: ASSIGN_TO_ARGS_INVALID + id: 57 + message: "Assigning to 'arguments' in strict mode is invalid." -- name: REQUIRED_PARAM_AFTER_DEFAULT - id: 14 - message: "Required parameter follows default parameter(s)." +- name: ASSIGN_TO_EVAL_INVALID + id: 51 + message: "Assigning to 'eval' in strict mode is invalid." -- name: REST_AND_DEFAULT_SAME_TIME - id: 15 - message: "Both optional and rest parameters are not allowed in function's parameter list." +- name: ASTERIKS_NOT_ALLOWED_IN_SELECTIVE_BINDING + id: 102 + message: "The '*' token is not allowed as a selective binding (between braces)." -- name: UNEXPECTED_TOKEN - id: 16 - message: "Unexpected token." +- name: ASYNC_CONSTRUCTOR + id: 200 + message: "Constructor should not be async." -- name: INDEX_TYPE_EXPECTED - id: 17 - message: "Index type expected in index signature." +- name: ASYNC_FLAG_ONLY_FOR_TOP_FUN + id: 202 + message: "'async' flags must be used for functions only at top-level." -- name: INDEX_TYPE_NOT_NUMBER - id: 18 - message: "Index type must be number in index signature." +- name: ASYNC_IN_AMBIENT_CONTEXT + id: 106 + message: "The modifier async cannot be used in an ambient context." -- name: EXPECTED_BRACKETS_IN_INDEX - id: 19 - message: "] expected in index signature." +- name: ASYNC_METHOD_LINE_TERM + id: 197 + message: "Async methods cannot have a line terminator between 'async' and the property name." -- name: INDEX_MISSING_TYPE - id: 20 - message: "An index signature must have a type annotation." +- name: AS_CONST_USAGE + id: 311 + message: "'as const' assertion is not supported." -- name: INDEX_MISSING_IDENTIFIER - id: 21 - message: "Return type of index signature from exported class or interface need to be identifier." +- name: AWAIT_IN_ARROW_FUN_PARAM + id: 46 + message: "await is not allowed in arrow function parameters." -- name: EXTENSION_GETTER_WRONG_PARAM - id: 22 - message: "Extension Getter can only have 1 parameter." +- name: AWAIT_RESERVED_IDENTIFIER_IN_MODULE + id: 213 + message: "'await' is a reserved identifier in module code." -- name: EXTENSION_SETTER_WRONG_PARAM - id: 23 - message: "Extension Setter can only have 2 parameters." +- name: BINDING_ARGS_INVALID + id: 182 + message: "Binding 'arguments' in strict mode is invalid." -- name: ANNOTATION_PROPERTY_ACCESS_MODIFIERS - id: 24 - message: "Annotation property can not have access modifiers." +- name: BINDING_EVAL_INVALID + id: 190 + message: "Binding 'eval' in strict mode is invalid." -- name: ANNOTATION_METHOD_AS_PROP - id: 25 - message: "Annotation can not have method as property." +- name: BINDING_PATTERN_PARAM_CANNOT_BE_OPTIONAL + id: 217 + message: "A binding pattern parameter cannot be optional in an implementation signature." -- name: INVALID_ARGUMENT_PASSED - id: 26 - message: "Invalid argument passed to '{}'." +- name: CANNOT_EXPORT_SAME_TYPE_TWICE + id: 284 + message: "Cannot export the same '{}' type twice." -- name: INVALID_VAL_ANNOTATION_FIELD - id: 27 - message: "Invalid value for annotation field, expected a constant literal." +- name: CAN_NOT_FIND_NAME_TO_EXPORT + id: 279 + message: "Cannot find name '{}' to export." -- name: ANNOTATION_WRONG_DEC - id: 28 - message: "Annotations are not allowed on this type of declaration." +- name: CAN_NOT_RENAME_ANNOTATION + id: 280 + message: "Can not rename annotation '{}' in export or import statements." -- name: ANNOTATION_ABSTRACT - id: 29 - message: "Annotations are not allowed on an abstract class or methods." +- name: CATCH_CLAUSE_VAR_HAS_INIT + id: 101 + message: "Catch clause variable cannot have an initializer." -- name: LOCAL_CLASS_ACCESS_MOD - id: 30 - message: "Local class or interface declaration members can not have access modifies." +- name: CLASS_FIELD_CONSTRUCTOR + id: 144 + message: "Classes may not have a field named 'constructor'." -- name: GETTER_SETTER_NOT_ABSTRACT - id: 31 - message: "Getter and setter methods must be abstracts in the interface body." +- name: CLASS_INTERFACE_METHOD_OVERLOADED_NAME_MUST_IDENT + id: 324 + message: "The overloaded method name in class/interface method overload declaration must be identifier." -- name: PRIVATE_INTERFACE_MISSING_BODY - id: 32 - message: "Private interface methods must have body." +- name: CLASS_OUT_OF_ORDER + id: 80 + message: "Class range out of order." -- name: READONLY_INTERFACE_METHOD - id: 33 - message: "Modifier 'readonly' cannot be applied to an interface method." +- name: CONFLICTING_FIELD_MODIFIERS + id: 127 + message: "Conflicting modifiers '!' and '?' on field." -- name: MULTIPLE_STATIC_BLOCK - id: 34 - message: "Only one static block is allowed in one namespace or class." +- name: CONSTANT_MULTI_INITIALIZED_IN_STATIC_BLOCK + id: 290 + message: "package constant property initialization can only be applied once in static block" -- name: INVALID_ENUM_TYPE - id: 35 - message: "Invalid enum initialization type." +- name: DECALRE_IN_AMBIENT_CONTEXT + id: 104 + message: "A 'declare' modifier cannot be used in an already ambient context." -- name: ENUM_INVALID_INIT - id: 36 - message: "Invalid enum initialization value" +- name: DECLARE_MODIFIER_ON_INVALID_CLASS_ELEMENT + id: 157 + message: "'declare modifier cannot appear on class elements of this kind." -- name: ONLY_CALL_AFTER_LAUNCH - id: 37 - message: "Only call expressions are allowed after 'launch'." +- name: DECORATORS_INVALID + id: 183 + message: "Decorators are not valid here." -- name: MISSING_LOOP_AFTER_LABEL - id: 38 - message: "Label must be followed by a loop statement." +- name: DEEP_NESTING + id: 305 + message: "Maximum allowed nesting level exceeded." -- name: MISSING_CATCH_OR_FINALLY_AFTER_TRY - id: 39 - message: "A try statement should contain either finally clause or at least one catch clause." +- name: DEFAULT_ONLY_FOR_OPTIONAL + id: 133 + message: "Default value is allowed only for optional parameters." -- name: ILLEGAL_START_STRUCT_CLASS - id: 40 - message: "Illegal start of {} expression." +- name: DEFAULT_UNDEF_NOT_ALLOWED + id: 132 + message: "Not enable default value with default undefined." -- name: ONLY_EXPORT_CLASS_OR_INTERFACE - id: 41 - message: "Can only type export class or interface." +- name: DELETING_LOCAL_VAR + id: 50 + message: "Deleting local variable in strict mode." -- name: INVALID_EXPORT_DEFAULT - id: 42 - message: "Can not export annotation default." +- name: DELETING_PRIVATE_FIELDS + id: 70 + message: "Private fields can not be deleted." -- name: EXPORT_NON_DECLARATION - id: 43 - message: "Export is allowed only for declarations." +- name: DIFFERENT_PACKAGE_NAME + id: 2 + message: "Files '{}' and '{}' are in the same folder, but have different package names." -- name: THIS_IN_NON_STATIC_METHOD - id: 44 - message: "A 'this' type is available only as return type in a non-static method of a class or struct and extension functions." +- name: DIVISION_BY_ZERO + id: 273 + message: "Division by zero is not allowed." -- name: UNEXPECTED_ID - id: 45 - message: "Unexpected identifier." +- name: DUPLICATED_IDENTIFIER + id: 215 + message: "Duplicated identifier." -- name: AWAIT_IN_ARROW_FUN_PARAM - id: 46 - message: "await is not allowed in arrow function parameters." +- name: DUPLICATED_MODIFIER + id: 115 + message: "Duplicated modifier is not allowed." -- name: UNEXPECTED_PRIVATE - id: 47 - message: "Unexpected private identifier." +- name: DUPLICATE_EXPORT_NAME + id: 281 + message: "The given name '{}' is already used in another export." -- name: IMPORT_META_DIRECT_EVAL - id: 48 - message: "'import.Meta' is not allowed in direct eval in module code." +- name: DUPLICATE_GROUP_NAME + id: 82 + message: "Duplicate group name." -- name: INVALID_DESTRUCTURING_TARGET - id: 49 - message: "Invalid destructuring assignment target." +- name: DUPLICATE_PROTO_FIELDS + id: 285 + message: "Duplicate __proto__ fields are not allowed in object literals" -- name: DELETING_LOCAL_VAR - id: 50 - message: "Deleting local variable in strict mode." +- name: ENUM_INVALID_INIT + id: 36 + message: "Invalid enum initialization value" -- name: ASSIGN_TO_EVAL_INVALID - id: 51 - message: "Assigning to 'eval' in strict mode is invalid." +- name: ENUM_OR_ANNOTATION_DIVIDE_BY_ZERO + id: 293 + message: "Division by zero are not allowed in Enum or Annotation" -- name: EXPECTED_EXPRESSION_GOT_ARROW - id: 52 - message: "Expected expression, got '=>'." +- name: ENUM_STRING_TYPE_ALL_ITEMS_INIT + id: 276 + message: "All items of string-type enumeration should be explicitly initialized." -- name: INVALID_LEFT_SITE_OPERATOR - id: 53 - message: "Invalid left-hand side operator." +- name: ERROR_ARKTS_NO_AMBIENT_DECLS + id: 308 + message: "Ambient module declaration is not supported!" -- name: YIELD_IN_GENERATOR_PARAM - id: 54 - message: "Yield is not allowed in generator parameters." +- name: ERROR_ARKTS_NO_DEBUGGER_STATEMENT + id: 299 + message: "Debugger statement is not supported!" -- name: INVALID_REST_ELEMENT - id: 55 - message: "Invalid rest element." +- name: ERROR_ARKTS_NO_EXPORT_ASSIGNMENT + id: 307 + message: "'export = ...' syntax is not supported, use regular import/export instead!" -- name: TAGGED_TEMPLATE_LITERALS_IN_OPTIONALCHAIN - id: 56 - message: "Tagged Template Literals are not allowed in optionalChain." +- name: ERROR_ARKTS_NO_IMPORT_ASSERTIONS + id: 313 + message: "Import assertion is not supported, please use the ordinary import syntax instead!" -- name: ASSIGN_TO_ARGS_INVALID - id: 57 - message: "Assigning to 'arguments' in strict mode is invalid." +- name: ERROR_ARKTS_NO_PRIVATE_IDENTIFIERS + id: 298 + message: "Use 'private' keyword to declare an identifier as private." -- name: GETTER_FORMAL_PARAMS - id: 58 - message: "Getter must not have formal parameters." +- name: ERROR_ARKTS_NO_REQUIRE + id: 312 + message: "Importing by 'require' and 'import' assignment is not supported, use 'import * as ... from ...' form instead!" -- name: NULLISH_COALESCING_MISSING_PARENS - id: 59 - message: "Nullish coalescing operator ?? requires parens when mixing with logical operators." +- name: ERROR_ARKTS_NO_VAR + id: 297 + message: "'var' keyword is not supported. Use 'let' instead." -- name: NEW_WITH_IMPORT - id: 60 - message: "Cannot use new with import(...)." +- name: ESCAPE_SEQUENCES_IN_AS + id: 108 + message: "Escape sequences are not allowed in 'as' keyword." -- name: UNEXPECTED_SUPER - id: 61 - message: "Unexpected super keyword." +- name: ESCAPE_SEQUENCES_IN_KEYWORD + id: 271 + message: "Escape sequences are not allowed in keyword." -- name: OBJECT_PATTER_CONTAIN_METHODS - id: 62 - message: "Object pattern can't contain methods." +- name: EVAL_OR_ARGUMENTS_IN_STRICT_MODE + id: 207 + message: "'eval' or 'arguments' can't be defined or assigned to in strict mode code." -- name: SETTER_FORMAL_PARAMS - id: 63 - message: "Setter must have exactly one formal parameter." +- name: EXPECTED_ARROW_SAME_LINE + id: 195 + message: "expected '=>' on the same line after an argument list, got line terminator." -- name: INSUFFICIENT_PARAM_IN_ARROW_FUN - id: 64 - message: "Insufficient formal parameter in arrow function." +- name: EXPECTED_BRACKETS_IN_INDEX + id: 19 + message: "] expected in index signature." -- name: ILLEGAL_AWAIT_IN_ASYNC_FUN - id: 65 - message: "Illegal await-expression in formal parameters of async function." +- name: EXPECTED_EXPRESSION_GOT_ARROW + id: 52 + message: "Expected expression, got '=>'." -- name: YIELD_IN_ARROW_FUN_PARAM - id: 66 - message: "yield is not allowed in arrow function parameters." +- name: EXPECTED_PARAM_GOT_PARAM + id: 230 + message: "Expected '{}', got '{}'." -- name: REST_PARAM_NOT_LAST - id: 67 - message: "Rest parameter must be the last formal parameter." +- name: EXPLICIT_PARAM_TYPE + id: 194 + message: "Parameter declaration should have an explicit type annotation." -- name: META_PROP_FOR_IMPORT - id: 68 - message: "The only valid meta property for import is import.Meta." +- name: EXPORT_DEFAULT_NO_REEXPORT + id: 244 + message: "Cannot use 'export default' in re-export context" -- name: IMPORT_META_ONLY_MODULE - id: 69 - message: "'import.Meta' may appear only with 'sourceType: module'." +- name: EXPORT_DEFAULT_WITH_MUPLTIPLE_SPECIFIER + id: 5 + message: "export default is not allowed to export multiple specifiers." -- name: DELETING_PRIVATE_FIELDS - id: 70 - message: "Private fields can not be deleted." +- name: EXPORT_IN_NAMESPACE + id: 111 + message: "Export declarations are not permitted in a namespace." -- name: INVALID_LEFT_IN_PREFIX - id: 71 - message: "Invalid left-hand side in prefix operation." +- name: EXPORT_NON_DECLARATION + id: 43 + message: "Export is allowed only for declarations." -- name: INVALID_LEFT_SIDE_IN_ASSIGNMENT - id: 72 - message: "Invalid left-hand side in assignment expression." +- name: EXPORT_WITHOUT_DECLARE_IN_DECL_MODULE + id: 296 + message: "Export keyword without declare shouldn't be used in declaration module." -- name: NEW_TARGET_IS_NOT_ALLOWED - id: 73 - message: "'new.Target' is not allowed here." +- name: EXTENSION_ACCESSOR_RECEIVER + id: 146 + message: "Extension Accessor must have a receiver." -- name: NEW_TARGET_WITH_ESCAPED_CHARS - id: 74 - message: "'new.Target' must not contain escaped characters." +- name: EXTENSION_GETTER_WRONG_PARAM + id: 22 + message: "Extension Getter can only have 1 parameter." -- name: INVALID_CLOSING_PARENTHESIS - id: 75 - message: "Invalid closing parenthesis." +- name: EXTENSION_SETTER_WRONG_PARAM + id: 23 + message: "Extension Setter can only have 2 parameters." -- name: INVALID_CAPTURING_GROUP - id: 76 - message: "Invalid capturing group." +- name: FIELD_IN_PARAM + id: 319 + message: "Declaring fields in parameter list is not supported" -- name: INVALID_CHAR - id: 77 - message: "Invalid character." +- name: FIELD_TPYE_ANNOTATION_MISSING + id: 121 + message: "Field type annotation expected." -- name: QUANTIFIER_OUT_OF_ORDER - id: 78 - message: "Quantifier range out of order." +- name: FOR_AWAIT_OF_VAR_NOT_INIT + id: 97 + message: "for-await-of loop variable declaration may not have an initializer." -- name: INVALIDE_CHAR_CLASS - id: 79 - message: "Invalid character class." +- name: FOR_IN_LOOP_HAS_INIT + id: 164 + message: "for-in loop variable declaration may not have an initializer." -- name: CLASS_OUT_OF_ORDER - id: 80 - message: "Class range out of order." +- name: FOR_OF_LOOP_HAS_INIT + id: 168 + message: "for-of loop variable declaration may not have an initializer." -- name: INVALID_DECIMAL_ESCAPE - id: 81 - message: "Invalid decimal escape." +- name: FUNCTION_OVERLOADED_NAME_MUST_QUALIFIED_NAME + id: 325 + message: "The overloaded method name in function overload declaration must be qualified name." -- name: DUPLICATE_GROUP_NAME - id: 82 - message: "Duplicate group name." +- name: FUNC_EXPR + id: 320 + message: "Function expressions are not supported, use arrow functions instead" -- name: INVALID_HEX_ESCAPE - id: 83 - message: "Invalid hex escape." +- name: FUNC_PARAM_THIS_FIRST + id: 158 + message: "Function Parameter 'this' must be the first." -- name: INVALID_GROUP_NAME - id: 84 - message: "Invalid group name." +- name: FUN_PARAM_THIS_MISSING_TYPE + id: 99 + message: "The function parameter 'this' must explicitly specify the typeAnnotation." -- name: INVALID_GROUP - id: 85 - message: "Invalid group." +- name: GENERATORS_ONLY_TOP_LEVEL_OR_INSIDE_BLOCK + id: 173 + message: "Generators can only be declared at the top level or inside a block." -- name: UNTERMINATED_UNICODE_PROP_ESCAPE - id: 86 - message: "Unterminated Unicode property escape." +- name: GENERATOR_FUNCTION + id: 314 + message: "Generator functions are not supported, please use async/await mechanism for multitasking" -- name: INVALID_ESCAPE - id: 87 - message: "Invalid escape." +- name: GETTER_FORMAL_PARAMS + id: 58 + message: "Getter must not have formal parameters." -- name: INVALID_QUANTIFIER - id: 88 - message: "Invalid quantifier, nothing to repeat." +- name: GETTER_SETTER_NOT_ABSTRACT + id: 31 + message: "Getter and setter methods must be abstracts in the interface body." -- name: INVALID_NAME_BACKREFERENCE - id: 89 - message: "Invalid named backreference." +- name: GET_ACCESSOR_MUST_BE_AT_LEAST_AS_ACCESSIBLE + id: 205 + message: "A get accessor must be at least as accessible as the setter." -- name: INVALID_NON_CAPTURING_GROUP - id: 90 - message: "Invalid non-capturing group." +- name: HARD_KEYWORD_IDENT + id: 316 + message: "Hard keyword '{}' cannot be used as identifier" -- name: INVALID_UNICODE_ESCAPE - id: 91 - message: "Invalid Unicode escape." +- name: HEXADECIMAL_EXPECTED + id: 248 + message: "Hexadecimal digit expected." -- name: INVALID_CONTROL_ESCAPE - id: 92 - message: "Invalid control escape." +- name: IDENTIFIER_EXPECTED + id: 131 + message: "Identifier is needed here." -- name: INVALID_ASSERT - id: 93 - message: "Invalid assertion." +- name: IDENTIFIER_EXPECTED_HERE + id: 224 + message: "Identifier expected, got '{}'." -- name: INVALID_UNICODE_PROP_ESCAPE - id: 94 - message: "Invalid Unicode property escape." +- name: ID_EXPECTED + id: 122 + message: "Identifier expected." -- name: UNEXPECTED_TOKEN_AS - id: 95 - message: "Unexpected token, expected 'as'." +- name: ILLEGALE_CONTINUE + id: 165 + message: "Illegal continue statement." -- name: OPTIONAL_VAR_IN_FOR_OF - id: 96 - message: "Optional variable is not allowed in for of statements." +- name: ILLEGAL_AWAIT_IN_ASYNC_FUN + id: 65 + message: "Illegal await-expression in formal parameters of async function." -- name: FOR_AWAIT_OF_VAR_NOT_INIT - id: 97 - message: "for-await-of loop variable declaration may not have an initializer." +- name: ILLEGAL_BREAK + id: 209 + message: "Illegal break statement." -- name: VARIANCE_NOD_ALLOWED - id: 98 - message: "Variance modifier is not allowed here." +- name: ILLEGAL_EXPRESSION_WRAP + id: 196 + message: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses." -- name: FUN_PARAM_THIS_MISSING_TYPE - id: 99 - message: "The function parameter 'this' must explicitly specify the typeAnnotation." +- name: ILLEGAL_NEW_LINE + id: 172 + message: "Illegal newline after throw." -- name: MISSING_INIT_OR_CONST_DEC - id: 100 - message: "Missing initializer in const declaration." +- name: ILLEGAL_START_EXPRESSION + id: 208 + message: "Illegal start of expression." -- name: CATCH_CLAUSE_VAR_HAS_INIT - id: 101 - message: "Catch clause variable cannot have an initializer." +- name: ILLEGAL_START_STRUCT_CLASS + id: 40 + message: "Illegal start of {} expression." -- name: ASTERIKS_NOT_ALLOWED_IN_SELECTIVE_BINDING - id: 102 - message: "The '*' token is not allowed as a selective binding (between braces)." +- name: ILLEGAL_USE_STRICT + id: 199 + message: "Illegal 'use strict' directive in function with non-simple parameter list." -- name: ONLY_THROWS_IN_FUN_TYPE - id: 103 - message: "Only 'throws' can be used with function types." +- name: IMPLEMENTS_CLAUSE_EMPTY + id: 185 + message: "Implements clause can not be empty." -- name: DECALRE_IN_AMBIENT_CONTEXT - id: 104 - message: "A 'declare' modifier cannot be used in an already ambient context." +- name: IMPLICIT_OCTAL_NOT_ALLOWED + id: 257 + message: "Implicit octal literal not allowed." -- name: MISSING_INIT_OR_TYPE - id: 105 - message: "Variable must be initialized or it's type must be declared." +- name: IMPORT_EXPORT_ONLY_AT_TOP_LEVEL + id: 166 + message: "'import' and 'export' may only appear at the top level." -- name: ASYNC_IN_AMBIENT_CONTEXT - id: 106 - message: "The modifier async cannot be used in an ambient context." +- name: IMPORT_META_DIRECT_EVAL + id: 48 + message: "'import.Meta' is not allowed in direct eval in module code." -- name: MODIFIERS_OF_GET_SET_LIMITED - id: 107 - message: "Modifiers of getter and setter are limited to ('abstract', 'static', 'final', 'override', 'native')." +- name: IMPORT_META_ONLY_MODULE + id: 69 + message: "'import.Meta' may appear only with 'sourceType: module'." -- name: ESCAPE_SEQUENCES_IN_AS - id: 108 - message: "Escape sequences are not allowed in 'as' keyword." +- name: IMPORT_TOP_LEVEL + id: 226 + message: "Import declarations can only be used on the top level and before any other declaration, top level statement or + directive." + +- name: IMPROPER_NESTING_CLASS + id: 233 + message: "Unexpected token. A constructor, method, accessor, or property was expected." + +- name: IMPROPER_NESTING_INTERFACE + id: 234 + message: "Property or signature expected." -- name: LOCAL_TYPE_DEC_NO_IMPLEMENTED - id: 109 - message: "Local type declaration (class, struct, interface and enum) support is not yet implemented." +- name: INDEX_MISSING_IDENTIFIER + id: 21 + message: "Return type of index signature from exported class or interface need to be identifier." -- name: TYPE_IMPORT_MISSING_SELECTIVE_BINDING - id: 110 - message: "Type import requires selective binding to define the required imported elements." +- name: INDEX_MISSING_TYPE + id: 20 + message: "An index signature must have a type annotation." -- name: EXPORT_IN_NAMESPACE - id: 111 - message: "Export declarations are not permitted in a namespace." +- name: INDEX_TYPE_EXPECTED + id: 17 + message: "Index type expected in index signature." -- name: UNEXPECTED_TOKEN_ID - id: 112 - message: "Unexpected token, expected an identifier." +- name: INDEX_TYPE_NOT_NUMBER + id: 18 + message: "Index type must be number in index signature." -- name: ANNOTATION_NOT_ALLOWED - id: 113 - message: "Annotations cannot be applied here." +- name: INITIALIZERS_INTERFACE_PROPS + id: 123 + message: "Initializers are not allowed on interface properties." -- name: ANNOTATION_ONLY_TOP_LEVEL - id: 114 - message: "Annotations can only be declared at the top level." +- name: INITIALIZERS_IN_AMBIENT_CONTEXTS + id: 125 + message: "Initializers are not allowed in ambient contexts." -- name: DUPLICATED_MODIFIER - id: 115 - message: "Duplicated modifier is not allowed." +- name: INIT_MODULE_DECLARATION_POSITION + id: 322 + message: "initModule() must only be called immediately after the import statement, and before any other declarations or + statements." -- name: NATIVE_METHOD_ASYNC - id: 116 - message: "Native method cannot be async." +- name: INSERT_NODE_ABSENT + id: 10 + message: "There is no any node to insert at the placeholder position." -- name: KEYWORD_CONTAINS_ESCAPED_CHARS - id: 117 - message: "Keyword must not contain escaped characters." +- name: INSUFFICIENT_PARAM_IN_ARROW_FUN + id: 64 + message: "Insufficient formal parameter in arrow function." -- name: ABSTRACT_METHOD_ASYNC - id: 118 - message: "Abstract method cannot be async." +- name: INTERFACE_DEC_IMPLEMENTS + id: 177 + message: "Interface declaration cannot have 'implements' clause." - name: INTERFACE_FIELDS_TYPE_ANNOTATION id: 119 message: "Interface fields must have type annotation." -- name: ACCESS_BEFORE_FIELD_METHOD - id: 120 - message: "Access modifier must precede field and method modifiers." +- name: INTERFACE_MEMBER_INIT_NOT_ALLOWED + id: 180 + message: "Interface member initialization is prohibited." -- name: FIELD_TPYE_ANNOTATION_MISSING - id: 121 - message: "Field type annotation expected." +- name: INVALIDE_CHAR_CLASS + id: 79 + message: "Invalid character class." -- name: ID_EXPECTED - id: 122 - message: "Identifier expected." +- name: INVALID_ACCESSOR + id: 159 + message: "Invalid accessor." -- name: INITIALIZERS_INTERFACE_PROPS - id: 123 - message: "Initializers are not allowed on interface properties." +- name: INVALID_ARGUMENT_ETSNOLINT + id: 278 + message: "Invalid argument for ETSNOLINT!" -- name: UNEXPECTED_TOKEN_PRIVATE_ID - id: 124 - message: "Unexpected token, expected 'private' or identifier." +- name: INVALID_ARGUMENT_PASSED + id: 26 + message: "Invalid argument passed to '{}'." -- name: INITIALIZERS_IN_AMBIENT_CONTEXTS - id: 125 - message: "Initializers are not allowed in ambient contexts." +- name: INVALID_ASSERT + id: 93 + message: "Invalid assertion." -- name: VAR_DEC_EXPECTED - id: 126 - message: "Variable declaration expected." +- name: INVALID_BIGINT + id: 255 + message: "Invalid BigInt number." -- name: CONFLICTING_FIELD_MODIFIERS - id: 127 - message: "Conflicting modifiers '!' and '?' on field." +- name: INVALID_CAPTURING_GROUP + id: 76 + message: "Invalid capturing group." -- name: VALUE_IS_NOT_SET - id: 128 - message: "You didn't set the value." +- name: INVALID_CHAR + id: 77 + message: "Invalid character." -- name: TYPE_ALIAS_ONLY_TOP_LEVEL - id: 129 - message: "Type alias is allowed only as top-level declaration." +- name: INVALID_CHAR_ESCAPE + id: 258 + message: "Invalid character escape sequence." -- name: INVALID_RIGHT_INSTANCEOF - id: 130 - message: "Invalid right-hand side in 'instanceof' expression." +- name: INVALID_CLASS_FIELD + id: 12 + message: "Cannot parse class field definition property." -- name: IDENTIFIER_EXPECTED - id: 131 - message: "Identifier is needed here." +- name: INVALID_CLASS_METHOD + id: 13 + message: "Cannot parse class method definition property." -- name: DEFAULT_UNDEF_NOT_ALLOWED - id: 132 - message: "Not enable default value with default undefined." +- name: INVALID_CLOSING_PARENTHESIS + id: 75 + message: "Invalid closing parenthesis." -- name: DEFAULT_ONLY_FOR_OPTIONAL - id: 133 - message: "Default value is allowed only for optional parameters." +- name: INVALID_CONTROL_ESCAPE + id: 92 + message: "Invalid control escape." -- name: NAMESPACE_ONLY_TOP_OR_IN_NAMESPACE - id: 134 - message: "Namespace is allowed only at the top level or inside a namespace." +- name: INVALID_DECIMAL_ESCAPE + id: 81 + message: "Invalid decimal escape." -- name: NESTED_FUNCTIONS_NOT_ALLOWED - id: 135 - message: "Nested functions are not allowed." +- name: INVALID_DECORATOR_CONSTRUCTOR + id: 201 + message: "The modifier for a constructor should be limited to access modifiers (private, internal, protected, public), and + 'native' modifiers." -- name: SPREAD_MUST_BE_LAST_IN_TUPLE - id: 136 - message: "Spread type must be at the last index in the tuple type." +- name: INVALID_DESTRUCTURING_TARGET + id: 49 + message: "Invalid destructuring assignment target." -- name: PRIMITIVE_NOT_ALLOWED - id: 137 - message: "Primitive type is not allowed here." +- name: INVALID_DIGIT + id: 266 + message: "Invalid digit." -- name: INVALID_TYPE - id: 138 - message: "Invalid Type." +- name: INVALID_ENUM_TYPE + id: 35 + message: "Invalid enum initialization type." -- name: SPREAD_TYPE_MUST_BE_ARRAY - id: 139 - message: "Spread type must be an array type." +- name: INVALID_ESCAPE + id: 87 + message: "Invalid escape." -- name: TYPE_ANNOTATION_FOR_CONSTRUCTOR - id: 140 - message: "Type annotation isn't allowed for constructor." +- name: INVALID_EXPORT_DEFAULT + id: 42 + message: "Can not export annotation default." -- name: READONLY_ONLY_ON_ARRAY_OR_TUPLE - id: 141 - message: "'readonly' type modifier is only permitted on resizable array and tuple types." +- name: INVALID_GROUP + id: 85 + message: "Invalid group." -- name: OPTIONAL_TYPES_IN_TUPLE_NOT_IMPLEMENTED - id: 142 - message: "Optional types in tuples are not yet implemented." +- name: INVALID_GROUP_NAME + id: 84 + message: "Invalid group name." -- name: ONLY_SPREAD_AT_LAST_INDEX - id: 143 - message: "Only one spread type declaration allowed, at the last index." +- name: INVALID_HEX_ESCAPE + id: 83 + message: "Invalid hex escape." -- name: CLASS_FIELD_CONSTRUCTOR - id: 144 - message: "Classes may not have a field named 'constructor'." +- name: INVALID_IDENTIFIER_PART + id: 263 + message: "Invalid identifier part." -- name: NOT_ALLOWED_USER_DEFINED_TYPE - id: 145 - message: "Cannot be used as user-defined type." +- name: INVALID_INIT_IN_PACKAGE + id: 288 + message: "Non-constant initializer of Package should be apply in Initializer Block." -- name: EXTENSION_ACCESSOR_RECEIVER - id: 146 - message: "Extension Accessor must have a receiver." +- name: INVALID_INSERT_NODE + id: 11 + message: "Inserting node type differs from that required by format specification." -- name: UNEXPECTED_TOKEN_ID_FUN - id: 147 - message: "Unexpected token, expected function identifier." +- name: INVALID_LEFT_FOR_IN + id: 174 + message: "Invalid left-hand side in for-in statement." -- name: UNEXPECTED_ARROWPARAM_ELEMENT - id: 148 - message: "Unexpected ArrowParameter element." +- name: INVALID_LEFT_FOR_IN_OF + id: 167 + message: "Invalid left-hand side in 'For[In/Of]Statement'." -- name: SPECIAL_METHOD_CONSTRUCTOR - id: 149 - message: "Constructor can not be special method." +- name: INVALID_LEFT_HAND_IN_FOR_OF + id: 211 + message: "Invalid left-hand side in 'for' statement: must have a single binding." -- name: TRAILING_COMMA_NOT_ALLOWED - id: 150 - message: "Trailing comma is not allowed in this context." +- name: INVALID_LEFT_IN_PREFIX + id: 71 + message: "Invalid left-hand side in prefix operation." -- name: UNEXPECTED_TOKEN_STRING_LITERAL - id: 151 - message: "Unexpected token, expected string literal." +- name: INVALID_LEFT_SIDE_ARRAY_DESTRUCTURING + id: 204 + message: "Invalid left-hand side in array destructuring pattern." + +- name: INVALID_LEFT_SIDE_IN_ASSIGNMENT + id: 72 + message: "Invalid left-hand side in assignment expression." -- name: RESTPARAM_INIT - id: 152 - message: "RestParameter does not support an initializer." +- name: INVALID_LEFT_SITE_OPERATOR + id: 53 + message: "Invalid left-hand side operator." -- name: UNEXPECTED_MODIFIER - id: 153 - message: "Unexpected modifier." +- name: INVALID_NAME_BACKREFERENCE + id: 89 + message: "Invalid named backreference." -- name: PRIVATE_FIELD_REDEC - id: 154 - message: "Private field has already been declared." +- name: INVALID_NODE_NUMBER + id: 8 + message: "Invalid node number in format expression." -- name: STATIC_PROPERTY_PROTOTYPE - id: 155 - message: "Classes may not have static property named prototype." +- name: INVALID_NODE_TYPE + id: 9 + message: "Invalid node type in format expression." -- name: RESTPARAM_ID_IN_DEC_CONTEXT - id: 156 - message: "RestParameter must be followed by an identifier in declaration contexts" +- name: INVALID_NON_CAPTURING_GROUP + id: 90 + message: "Invalid non-capturing group." -- name: DECLARE_MODIFIER_ON_INVALID_CLASS_ELEMENT - id: 157 - message: "'declare modifier cannot appear on class elements of this kind." +- name: INVALID_NUM + id: 249 + message: "Invalid number." -- name: FUNC_PARAM_THIS_FIRST - id: 158 - message: "Function Parameter 'this' must be the first." +- name: INVALID_NUMERIC_LIT + id: 251 + message: "Invalid numeric literal." -- name: INVALID_ACCESSOR - id: 159 - message: "Invalid accessor." +- name: INVALID_NUMERIC_SEP + id: 254 + message: "Invalid numeric separator." -- name: UNEXPECTED_TOKEN_IN_PRIVATE - id: 160 - message: "Unexpected token in private field." +- name: INVALID_NUMERIC_SEP_AT_END_OF_NUM + id: 250 + message: "Numeric separators are not allowed at the end of numeric literals." -- name: WITH_DEPRECATED - id: 161 - message: "'With' is deprecated and not supported any more." +- name: INVALID_OCTAL_DIGIT + id: 239 + message: "Invalid octal digit." -- name: UNDEFINED_LABEL - id: 162 - message: "Undefined label." +- name: INVALID_PACKAGE_TOP_LEVEL_STMT + id: 291 + message: "Invalid package toplevel statement" -- name: RETURN_IN_FUN_BODY - id: 163 - message: "return keyword should be used in function body." +- name: INVALID_QUANTIFIER + id: 88 + message: "Invalid quantifier, nothing to repeat." -- name: FOR_IN_LOOP_HAS_INIT - id: 164 - message: "for-in loop variable declaration may not have an initializer." +- name: INVALID_REGEX_FLAG + id: 246 + message: "Invalid RegExp flag." -- name: ILLEGALE_CONTINUE - id: 165 - message: "Illegal continue statement." +- name: INVALID_REST_ELEMENT + id: 55 + message: "Invalid rest element." -- name: IMPORT_EXPORT_ONLY_AT_TOP_LEVEL - id: 166 - message: "'import' and 'export' may only appear at the top level." +- name: INVALID_RIGHT_INSTANCEOF + id: 130 + message: "Invalid right-hand side in 'instanceof' expression." -- name: INVALID_LEFT_FOR_IN_OF - id: 167 - message: "Invalid left-hand side in 'For[In/Of]Statement'." +- name: INVALID_SHORTHAND_PROPERTY_INITIALIZER + id: 286 + message: "Invalid shorthand property initializer." -- name: FOR_OF_LOOP_HAS_INIT - id: 168 - message: "for-of loop variable declaration may not have an initializer." +- name: INVALID_TYPE + id: 138 + message: "Invalid Type." -- name: MISSING_CATCH_OR_FINALLY - id: 169 - message: "Missing catch or finally clause." +- name: INVALID_TYPE_ANNOTATION_IN_FOR + id: 212 + message: "Type annotation is not allowed when existing variable is used as loop iterator in 'for' statement." -- name: UNEXPECTED_TOKEN_WHILE - id: 170 - message: "Unexpected token, expected 'while'." +- name: INVALID_UNICODE_ESCAPE + id: 91 + message: "Invalid Unicode escape." -- name: MULTIPLE_DEFAULT - id: 171 - message: "Multiple default clauses." +- name: INVALID_UNICODE_PROP_ESCAPE + id: 94 + message: "Invalid Unicode property escape." -- name: ILLEGAL_NEW_LINE - id: 172 - message: "Illegal newline after throw." +- name: INVALID_VAL_ANNOTATION_FIELD + id: 27 + message: "Invalid value for annotation field, expected a constant literal." -- name: GENERATORS_ONLY_TOP_LEVEL_OR_INSIDE_BLOCK - id: 173 - message: "Generators can only be declared at the top level or inside a block." +- name: KEYWORD_CONTAINS_ESCAPED_CHARS + id: 117 + message: "Keyword must not contain escaped characters." -- name: INVALID_LEFT_FOR_IN - id: 174 - message: "Invalid left-hand side in for-in statement." +- name: LABEL_ALREADY_DECLARED + id: 214 + message: "Label already declared." + +- name: LATE_INITIALIZATION_FIELD_HAS_DEFAULT_VALUE + id: 304 + message: "Late-initialized field cannot have default value." - name: LEXICAL_DEC_NOT_ALLOWED_IN_SINGLE_STATEMENT_CONTEXT id: 175 message: "Lexical declaration is not allowed in single statement context." -- name: TYPE_PARAM_DEC_EXPECTED - id: 176 - message: "Type parameter declaration expected." - -- name: INTERFACE_DEC_IMPLEMENTS - id: 177 - message: "Interface declaration cannot have 'implements' clause." - -- name: UNEXPECTED_TOKEN_ENUM - id: 178 - message: "Unexpected token in enum member." - -- name: REQUIRED_TYPE_PARAM_AFTER_OPTIONAL - id: 179 - message: "Required type parameters may not follow optional type parameters." +- name: LITERAL_VALUE_IDENT + id: 315 + message: "Number, string or computed value property name '{}' is not allowed, use classes to access data by property names + that are identifiers" -- name: INTERFACE_MEMBER_INIT_NOT_ALLOWED - id: 180 - message: "Interface member initialization is prohibited." +- name: LOCAL_CLASS_ACCESS_MOD + id: 30 + message: "Local class or interface declaration members can not have access modifies." -- name: ONLY_AMBIENT_MODULES_QUOTED_NAMES - id: 181 - message: "Only ambient modules can use quoted names." +- name: LOCAL_TYPE_DEC_NO_IMPLEMENTED + id: 109 + message: "Local type declaration (class, struct, interface and enum) support is not yet implemented." -- name: BINDING_ARGS_INVALID - id: 182 - message: "Binding 'arguments' in strict mode is invalid." +- name: META_PROP_FOR_IMPORT + id: 68 + message: "The only valid meta property for import is import.Meta." -- name: DECORATORS_INVALID - id: 183 - message: "Decorators are not valid here." +- name: MISSING_CATCH_OR_FINALLY + id: 169 + message: "Missing catch or finally clause." -- name: ABSTRACT_METHODS_ONLY_IN_ABSTRACT_CLASS - id: 184 - message: "Abstract methods can only appear within an abstract class." +- name: MISSING_CATCH_OR_FINALLY_AFTER_TRY + id: 39 + message: "A try statement should contain either finally clause or at least one catch clause." -- name: IMPLEMENTS_CLAUSE_EMPTY - id: 185 - message: "Implements clause can not be empty." +- name: MISSING_INIT_FOR_CONST_PACKAGE_PROP + id: 294 + message: "Missing initialization for const package property" - name: MISSING_INIT_IN_DEST_DEC id: 186 message: "Missing initializer in destructuring declaration." -- name: UNEXPECTED_TOKEN_FOR_PARAM - id: 187 - message: "Unexpected '?' for parameter." - -- name: TYPE_EXPECTED - id: 188 - message: "Type expected." +- name: MISSING_INIT_OR_CONST_DEC + id: 100 + message: "Missing initializer in const declaration." -- name: OVERRIDE_IN_INTERFACE - id: 189 - message: "'override' modifier cannot appear in interfaces." +- name: MISSING_INIT_OR_TYPE + id: 105 + message: "Variable must be initialized or it's type must be declared." -- name: BINDING_EVAL_INVALID - id: 190 - message: "Binding 'eval' in strict mode is invalid." +- name: MISSING_LOOP_AFTER_LABEL + id: 38 + message: "Label must be followed by a loop statement." -- name: TYPE_PARAM_LIST_EMPTY - id: 191 - message: "Type parameter list cannot be empty." +- name: MISSING_LOOP_BODY + id: 300 + message: "Missing body in {} statement" -- name: NO_DEFAULT_FOR_REST - id: 192 - message: "Rest parameter cannot have the default value." +- name: MISSING_LOOP_CONDITION + id: 301 + message: "Missing condition in {} statement" -- name: ONLY_ARRAY_OR_TUPLE_FOR_REST - id: 193 - message: "Rest parameter should be either array or tuple type." +- name: MISSING_TYPE_ANNOTATION + id: 1 + message: "Missing type annotation for property '{}'." -- name: EXPLICIT_PARAM_TYPE - id: 194 - message: "Parameter declaration should have an explicit type annotation." +- name: MODIFIERS_OF_GET_SET_LIMITED + id: 107 + message: "Modifiers of getter and setter are limited to ('abstract', 'static', 'final', 'override', 'native')." -- name: EXPECTED_ARROW_SAME_LINE - id: 195 - message: "expected '=>' on the same line after an argument list, got line terminator." +- name: MORE_INDEXER + id: 326 + message: "Only one index signature can exist in a class" -- name: ILLEGAL_EXPRESSION_WRAP - id: 196 - message: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses." +- name: MULTIPLE_CONSTRUCTOR_IMPLEMENTATIONS + id: 206 + message: "Multiple constructor implementations are not allowed." -- name: ASYNC_METHOD_LINE_TERM - id: 197 - message: "Async methods cannot have a line terminator between 'async' and the property name." +- name: MULTIPLE_DEFAULT + id: 171 + message: "Multiple default clauses." -- name: STRICT_MODE_FUNC_DECL - id: 198 - message: "In strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement." +- name: MULTIPLE_STATIC_BLOCK + id: 34 + message: "Only one static block is allowed in one namespace or class." -- name: ILLEGAL_USE_STRICT - id: 199 - message: "Illegal 'use strict' directive in function with non-simple parameter list." +- name: NAMESPACE_ANNOTATION_CONFLICT + id: 7 + message: "Annotation conflict! Multiple namespace declarations for '{}' cannot each have annotations." -- name: ASYNC_CONSTRUCTOR - id: 200 - message: "Constructor should not be async." +- name: NAMESPACE_MERGE_ERROR + id: 6 + message: "Unable to merge namespaces '{}', because their modifiers are different." -- name: INVALID_DECORATOR_CONSTRUCTOR - id: 201 - message: "The modifier for a constructor should be limited to access modifiers (private, internal, protected, public), and 'native' modifiers." +- name: NAMESPACE_ONLY_TOP_OR_IN_NAMESPACE + id: 134 + message: "Namespace is allowed only at the top level or inside a namespace." -- name: ASYNC_FLAG_ONLY_FOR_TOP_FUN - id: 202 - message: "'async' flags must be used for functions only at top-level." +- name: NAME_CANNOT_BE_EXPORTED_AND_TYPE_EXPORTED + id: 283 + message: "Name '{}' cannot be exported and type exported at the same time." - name: NATIVE_FLAG_ONLY_FOR_TOP_FUN id: 203 message: "'native' flags must be used for functions only at top-level." -- name: INVALID_LEFT_SIDE_ARRAY_DESTRUCTURING - id: 204 - message: "Invalid left-hand side in array destructuring pattern." - -- name: GET_ACCESSOR_MUST_BE_AT_LEAST_AS_ACCESSIBLE - id: 205 - message: "A get accessor must be at least as accessible as the setter." - -- name: MULTIPLE_CONSTRUCTOR_IMPLEMENTATIONS - id: 206 - message: "Multiple constructor implementations are not allowed." - -- name: EVAL_OR_ARGUMENTS_IN_STRICT_MODE - id: 207 - message: "'eval' or 'arguments' can't be defined or assigned to in strict mode code." - -- name: ILLEGAL_START_EXPRESSION - id: 208 - message: "Illegal start of expression." +- name: NATIVE_METHOD_ASYNC + id: 116 + message: "Native method cannot be async." -- name: ILLEGAL_BREAK - id: 209 - message: "Illegal break statement." +- name: NESTED_FUNCTIONS_NOT_ALLOWED + id: 135 + message: "Nested functions are not allowed." -- name: ANNOTATION_DECLARATION_ACCESS_MODIFIER - id: 210 - message: "Annotation declaration can not have access modifier." +- name: NEWLINE_NOT_ALLOWED_IN_STRING + id: 265 + message: "Newline is not allowed in strings" -- name: INVALID_LEFT_HAND_IN_FOR_OF - id: 211 - message: "Invalid left-hand side in 'for' statement: must have a single binding." +- name: NEW_TARGET_IS_NOT_ALLOWED + id: 73 + message: "'new.Target' is not allowed here." -- name: INVALID_TYPE_ANNOTATION_IN_FOR - id: 212 - message: "Type annotation is not allowed when existing variable is used as loop iterator in 'for' statement." +- name: NEW_TARGET_WITH_ESCAPED_CHARS + id: 74 + message: "'new.Target' must not contain escaped characters." -- name: AWAIT_RESERVED_IDENTIFIER_IN_MODULE - id: 213 - message: "'await' is a reserved identifier in module code." +- name: NEW_WITH_IMPORT + id: 60 + message: "Cannot use new with import(...)." -- name: LABEL_ALREADY_DECLARED - id: 214 - message: "Label already declared." +- name: NON_OCTAL_DECIAML_INTEGER_LIT_IN_STRICT_MODE + id: 256 + message: "NonOctalDecimalIntegerLiteral is not enabled in strict mode code." -- name: DUPLICATED_IDENTIFIER - id: 215 - message: "Duplicated identifier." +- name: NOT_ALLOWED_USER_DEFINED_TYPE + id: 145 + message: "Cannot be used as user-defined type." -- name: PARAM_CANNOT_HAVE_QUESTION_MARK - id: 216 - message: "Parameter cannot have question mark and initializer." +- name: NOT_AS_OBJECT + id: 318 + message: "{} cannot be used as object." -- name: BINDING_PATTERN_PARAM_CANNOT_BE_OPTIONAL - id: 217 - message: "A binding pattern parameter cannot be optional in an implementation signature." +- name: NO_DEFAULT_FOR_REST + id: 192 + message: "Rest parameter cannot have the default value." -- name: REST_PARAM_CANNOT_BE_OPTIONAL - id: 218 - message: "A rest parameter cannot be optional." +- name: NULLISH_COALESCING_MISSING_PARENS + id: 59 + message: "Nullish coalescing operator ?? requires parens when mixing with logical operators." -- name: REQUIRED_PARAM_AFTER_OPTIONAL - id: 219 - message: "A required parameter cannot follow an optional parameter." +- name: NUMERIC_SEP_UNDERSCORE_IN_NUMBER + id: 252 + message: "Numeric separator '_' is not allowed in numbers that start with '0'." -- name: SPECIAL_PREDEFINED_METHOD_CANNOT_BE_ASYNC - id: 220 - message: "The special predefined method '{}' cannot be asynchronous." +- name: OBJECT_PATTER_CONTAIN_METHODS + id: 62 + message: "Object pattern can't contain methods." -- name: SPECIAL_PREDEFINED_METHOD_SHOULD_HAVE_ONE_PARAM - id: 221 - message: "The special predefined method '{}' should have exactly one required parameter." +- name: OCTAL_ESCAPE_IN_TEMPLATE_STRINGS + id: 247 + message: "Octal escape sequences are not allowed in template strings." -- name: SPECIAL_PREDEFINED_METHOD_SHOULD_HAVE_TWO_PARAMS - id: 222 - message: "The special predefined method '{}' should have exactly two required parameter." +- name: ONLY_AMBIENT_MODULES_QUOTED_NAMES + id: 181 + message: "Only ambient modules can use quoted names." -- name: SPECIAL_PREDEFINED_METHOD_SHOULD_NOT_HAVE_PARAMS - id: 223 - message: "The special predefined method '{}' should not have parameters." +- name: ONLY_ARRAY_OR_TUPLE_FOR_REST + id: 193 + message: "Rest parameter should be either array or tuple type." -- name: IDENTIFIER_EXPECTED_HERE - id: 224 - message: "Identifier expected, got '{}'." +- name: ONLY_CALL_AFTER_LAUNCH + id: 37 + message: "Only call expressions are allowed after 'launch'." -- name: TYPE_ALIAS_INVALID_NAME - id: 225 - message: "Type alias name cannot be '{}'." +- name: ONLY_CONSTANT_ALLOWED + id: 292 + message: "Only constant expression is expected in the field" -- name: IMPORT_TOP_LEVEL - id: 226 - message: "Import declarations can only be used on the top level and before any other declaration, top level statement or directive." +- name: ONLY_CONSTANT_EXPRESSION + id: 272 + message: "Only constant expression is expected in the field" -- name: UNEXPECTED_TOKEN_PARAM - id: 227 - message: "Unexpected token '{}'." +- name: ONLY_EXPORT_CLASS_OR_INTERFACE + id: 41 + message: "Can only type export class or interface." -- name: UNEXPECTED_TOKEN_EXPECTED_PARAM - id: 228 - message: "Unexpected token, expected '{}'." +- name: ONLY_SPREAD_AT_LAST_INDEX + id: 143 + message: "Only one spread type declaration allowed, at the last index." -- name: UNEXPECTED_TOKEN_EXPECTED_PARAM_OR_PARAM - id: 229 - message: "Unexpected token, expected '{}' or '{}'." +- name: ONLY_STRING_LITERAL_IN_INIT_MODULE + id: 321 + message: "initModule() only accept string literal as argument." -- name: EXPECTED_PARAM_GOT_PARAM - id: 230 - message: "Expected '{}', got '{}'." +- name: ONLY_THROWS_IN_FUN_TYPE + id: 103 + message: "Only 'throws' can be used with function types." -- name: UNEXPECTED_TOKEN_PARAM_EXPECTED_CASE_OR_DEFAULT - id: 231 - message: "Unexpected token '{}', expected 'case' or 'default'." +- name: OPTIONAL_TYPES_IN_TUPLE_NOT_IMPLEMENTED + id: 142 + message: "Optional types in tuples are not yet implemented." -- name: PARAM_MODIFIER_CANNOT_APPEAR_ON_PARAMETER - id: 232 - message: "'{}' modifier cannot appear on a parameter." +- name: OPTIONAL_VARIABLE + id: 306 + message: "Optional variable is deprecated and no longer supported." -- name: IMPROPER_NESTING_CLASS - id: 233 - message: "Unexpected token. A constructor, method, accessor, or property was expected." +- name: OPTIONAL_VAR_IN_FOR_OF + id: 96 + message: "Optional variable is not allowed in for of statements." -- name: IMPROPER_NESTING_INTERFACE - id: 234 - message: "Property or signature expected." +- name: OVERLOAD_MODIFIERS + id: 323 + message: "Overload Declaration only allow use modifier 'static' | 'async'." -- name: UNEXPECTED_DEFAULT - id: 235 - message: "Unexpected token 'default'. Only declarations are allowed after 'export default'." +- name: OVERRIDE_IN_INTERFACE + id: 189 + message: "'override' modifier cannot appear in interfaces." -- name: REST_PARAM_LAST - id: 236 - message: "Rest parameter should be the last one." +- name: PACKAGE_MODULE_IMPORT_OWN_PACKAGE + id: 3 + message: "Package module cannot import from a file in it's own package." -- name: READONLY_TYPE_EXPECTED - id: 237 - message: "Readonly utility type expected but readonly found." +- name: PACKAGE_MULTIPLE_STATIC_BLOCK + id: 289 + message: "static block cannot apply to multi-files for one package" -- name: PROHIBITED_ACCESS_MODIFIER_IN_AMBIENT_CLASS - id: 238 - message: "Methods or fields should not be decorated with {} in ambient class." +- name: PARAM_CANNOT_HAVE_QUESTION_MARK + id: 216 + message: "Parameter cannot have question mark and initializer." -- name: INVALID_OCTAL_DIGIT - id: 239 - message: "Invalid octal digit." +- name: PARAM_MODIFIER_CANNOT_APPEAR_ON_PARAMETER + id: 232 + message: "'{}' modifier cannot appear on a parameter." -- name: UNEXPECTED_THIS - id: 240 - message: "Unexpected 'this' keyword in non-receiver context." +- name: PREDEFINED_TYPE_AS_IDENTIFIER + id: 295 + message: "{} is a predefined type, cannot be used as an identifier" -- name: SETTER_NO_RETURN_TYPE - id: 241 - message: "Setter must not have return type even if it is void." +- name: PRIMITIVE_NOT_ALLOWED + id: 137 + message: "Primitive type is not allowed here." -- name: USING_RESERVED_NAME_AS_VARIABLE_OR_TYPE_NAME - id: 242 - message: "'{}' is reserved and cannot be used as a variable/type name" +- name: PRIVATE_FIELD_MISMATCH + id: 302 + message: "Private field '{}' must be declared in an enclosing class" -- name: UNHANDLED_THROW_IN_INITIALIZER - id: 243 - message: "Unhandled throw statement." +- name: PRIVATE_FIELD_REDEC + id: 154 + message: "Private field has already been declared." -- name: EXPORT_DEFAULT_NO_REEXPORT - id: 244 - message: "Cannot use 'export default' in re-export context" +- name: PRIVATE_IDENTIFIER_NOT_CONSTRUCTOR + id: 267 + message: "Private identifier can not be constructor." -- name: UNTERMINATED_MULTI_LINE_COMMENT - id: 245 - message: "Unterminated multi-line comment." +- name: PRIVATE_IDENTIFIER_NUMBER + id: 269 + message: "Private identifier name can not be number." -- name: INVALID_REGEX_FLAG - id: 246 - message: "Invalid RegExp flag." +- name: PRIVATE_IDENTIFIER_STRING + id: 268 + message: "Private identifier name can not be string." -- name: OCTAL_ESCAPE_IN_TEMPLATE_STRINGS - id: 247 - message: "Octal escape sequences are not allowed in template strings." +- name: PRIVATE_INTERFACE_MISSING_BODY + id: 32 + message: "Private interface methods must have body." -- name: HEXADECIMAL_EXPECTED - id: 248 - message: "Hexadecimal digit expected." +- name: PROHIBITED_ACCESS_MODIFIER_IN_AMBIENT_CLASS + id: 238 + message: "Methods or fields should not be decorated with {} in ambient class." -- name: INVALID_NUM - id: 249 - message: "Invalid number." +- name: QUANTIFIER_OUT_OF_ORDER + id: 78 + message: "Quantifier range out of order." -- name: INVALID_NUMERIC_SEP_AT_END_OF_NUM - id: 250 - message: "Numeric separators are not allowed at the end of numeric literals." +- name: READONLY_INTERFACE_METHOD + id: 33 + message: "Modifier 'readonly' cannot be applied to an interface method." -- name: INVALID_NUMERIC_LIT - id: 251 - message: "Invalid numeric literal." +- name: READONLY_ONLY_ON_ARRAY_OR_TUPLE + id: 141 + message: "'readonly' type modifier is only permitted on resizable array and tuple types." -- name: NUMERIC_SEP_UNDERSCORE_IN_NUMBER - id: 252 - message: "Numeric separator '_' is not allowed in numbers that start with '0'." +- name: READONLY_TYPE_EXPECTED + id: 237 + message: "Readonly utility type expected but readonly found." -- name: UNTERMINATED_STRING - id: 253 - message: "Unterminated string." +- name: REQUIRED_PARAM_AFTER_DEFAULT + id: 14 + message: "Required parameter follows default parameter(s)." -- name: INVALID_NUMERIC_SEP - id: 254 - message: "Invalid numeric separator." +- name: REQUIRED_PARAM_AFTER_OPTIONAL + id: 219 + message: "A required parameter cannot follow an optional parameter." -- name: INVALID_BIGINT - id: 255 - message: "Invalid BigInt number." +- name: REQUIRED_TYPE_PARAM_AFTER_OPTIONAL + id: 179 + message: "Required type parameters may not follow optional type parameters." -- name: NON_OCTAL_DECIAML_INTEGER_LIT_IN_STRICT_MODE - id: 256 - message: "NonOctalDecimalIntegerLiteral is not enabled in strict mode code." +- name: RESTPARAM_ID_IN_DEC_CONTEXT + id: 156 + message: "RestParameter must be followed by an identifier in declaration contexts" -- name: IMPLICIT_OCTAL_NOT_ALLOWED - id: 257 - message: "Implicit octal literal not allowed." +- name: RESTPARAM_INIT + id: 152 + message: "RestParameter does not support an initializer." -- name: INVALID_CHAR_ESCAPE - id: 258 - message: "Invalid character escape sequence." +- name: REST_AND_DEFAULT_SAME_TIME + id: 15 + message: "Both optional and rest parameters are not allowed in function's parameter list." -- name: UNEXPECTED_TOKEN_EXPECTED_BACKTICK_OR_DOLLAR_LBRACE - id: 259 - message: "Unexpected token, expected '${' or '`'" +- name: REST_PARAM_CANNOT_BE_OPTIONAL + id: 218 + message: "A rest parameter cannot be optional." -- name: UNTERMINATED_REGEX - id: 260 - message: "Unterminated RegExp." +- name: REST_PARAM_LAST + id: 236 + message: "Rest parameter should be the last one." -- name: UNSUPPORTED_CHAR_LIT - id: 261 - message: "Unsupported character literal." +- name: REST_PARAM_NOT_LAST + id: 67 + message: "Rest parameter must be the last formal parameter." -- name: TOO_LARGE_NUM - id: 262 - message: "Number is too large." +- name: RETURN_IN_FUN_BODY + id: 163 + message: "return keyword should be used in function body." -- name: INVALID_IDENTIFIER_PART - id: 263 - message: "Invalid identifier part." +- name: RETURN_WITH_VALUE + id: 287 + message: "Unexpected return value." -- name: UNEXPECTED_STRICT_MODE_RESERVED_KEYWORD - id: 264 - message: "Unexpected strict mode reserved keyword." +- name: SETTER_FORMAL_PARAMS + id: 63 + message: "Setter must have exactly one formal parameter." -- name: NEWLINE_NOT_ALLOWED_IN_STRING - id: 265 - message: "Newline is not allowed in strings" +- name: SETTER_NO_RETURN_TYPE + id: 241 + message: "Setter must not have return type even if it is void." -- name: INVALID_DIGIT - id: 266 - message: "Invalid digit." +- name: SPECIAL_METHOD_CONSTRUCTOR + id: 149 + message: "Constructor can not be special method." -- name: PRIVATE_IDENTIFIER_NOT_CONSTRUCTOR - id: 267 - message: "Private identifier can not be constructor." +- name: SPECIAL_PREDEFINED_METHOD_CANNOT_BE_ASYNC + id: 220 + message: "The special predefined method '{}' cannot be asynchronous." -- name: PRIVATE_IDENTIFIER_STRING - id: 268 - message: "Private identifier name can not be string." +- name: SPECIAL_PREDEFINED_METHOD_SHOULD_HAVE_ONE_PARAM + id: 221 + message: "The special predefined method '{}' should have exactly one required parameter." -- name: PRIVATE_IDENTIFIER_NUMBER - id: 269 - message: "Private identifier name can not be number." +- name: SPECIAL_PREDEFINED_METHOD_SHOULD_HAVE_TWO_PARAMS + id: 222 + message: "The special predefined method '{}' should have exactly two required parameter." -- name: UNEXPECTED_CHAR_PRIVATE_IDENTIFIER - id: 270 - message: "Unexpected character in private identifier." +- name: SPECIAL_PREDEFINED_METHOD_SHOULD_NOT_HAVE_PARAMS + id: 223 + message: "The special predefined method '{}' should not have parameters." -- name: ESCAPE_SEQUENCES_IN_KEYWORD - id: 271 - message: "Escape sequences are not allowed in keyword." +- name: SPREAD_MUST_BE_LAST_IN_TUPLE + id: 136 + message: "Spread type must be at the last index in the tuple type." -- name: ONLY_CONSTANT_EXPRESSION - id: 272 - message: "Only constant expression is expected in the field" +- name: SPREAD_TYPE_MUST_BE_ARRAY + id: 139 + message: "Spread type must be an array type." -- name: DIVISION_BY_ZERO - id: 273 - message: "Division by zero is not allowed." +- name: STATIC_LATE_INITIALIZATION_FIELD_INVALID_MODIFIER + id: 303 + message: "Late-initialized field cannot be defined as static." -- name: UNSUPPORTED_OPERATOR_FOR_STRING - id: 274 - message: "Unsupported operator for String." +- name: STATIC_PROPERTY_PROTOTYPE + id: 155 + message: "Classes may not have static property named prototype." + +- name: STRICT_MODE_FUNC_DECL + id: 198 + message: "In strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement." - name: STRING_INTERPOLATION_NOT_CONSTANT id: 275 message: "String Interpolation Expression is not constant expression." -- name: ENUM_STRING_TYPE_ALL_ITEMS_INIT - id: 276 - message: "All items of string-type enumeration should be explicitly initialized." +- name: TAGGED_TEMPLATE_LITERALS_IN_OPTIONALCHAIN + id: 56 + message: "Tagged Template Literals are not allowed in optionalChain." -- name: UNEXPECTED_CHAR_ETSNOLINT - id: 277 - message: "Unexpected character for ETSNOLINT argument! [VALID ONLY: a-z, '-']." +- name: THIS_IN_NON_STATIC_METHOD + id: 44 + message: "A 'this' type is available only as return type in a non-static method of a class or struct and extension functions." -- name: INVALID_ARGUMENT_ETSNOLINT - id: 278 - message: "Invalid argument for ETSNOLINT!" +- name: TOO_LARGE_NUM + id: 262 + message: "Number is too large." -- name: CAN_NOT_FIND_NAME_TO_EXPORT - id: 279 - message: "Cannot find name '{}' to export." +- name: TRAILING_COMMA_NOT_ALLOWED + id: 150 + message: "Trailing comma is not allowed in this context." -- name: CAN_NOT_RENAME_ANNOTATION - id: 280 - message: "Can not rename annotation '{}' in export or import statements." +- name: TYPEOF_IN_ANNOTATION + id: 309 + message: "Result of 'typeof' operator is not supported to be used as type annotation." -- name: DUPLICATE_EXPORT_NAME - id: 281 - message: "The given name '{}' is already used in another export." +- name: TYPE_ALIAS_INVALID_NAME + id: 225 + message: "Type alias name cannot be '{}'." -- name: ALREADY_EXPORTED - id: 282 - message: "Cannot export '{}', it was already exported." +- name: TYPE_ALIAS_ONLY_TOP_LEVEL + id: 129 + message: "Type alias is allowed only as top-level declaration." -- name: NAME_CANNOT_BE_EXPORTED_AND_TYPE_EXPORTED - id: 283 - message: "Name '{}' cannot be exported and type exported at the same time." +- name: TYPE_ANNOTATION_FOR_CONSTRUCTOR + id: 140 + message: "Type annotation isn't allowed for constructor." + +- name: TYPE_EXPECTED + id: 188 + message: "Type expected." + +- name: TYPE_IMPORT_MISSING_SELECTIVE_BINDING + id: 110 + message: "Type import requires selective binding to define the required imported elements." + +- name: TYPE_PARAM_DEC_EXPECTED + id: 176 + message: "Type parameter declaration expected." -- name: CANNOT_EXPORT_SAME_TYPE_TWICE - id: 284 - message: "Cannot export the same '{}' type twice." +- name: TYPE_PARAM_LIST_EMPTY + id: 191 + message: "Type parameter list cannot be empty." -- name: DUPLICATE_PROTO_FIELDS - id: 285 - message: "Duplicate __proto__ fields are not allowed in object literals" +- name: UNDEFINED_LABEL + id: 162 + message: "Undefined label." -- name: INVALID_SHORTHAND_PROPERTY_INITIALIZER - id: 286 - message: "Invalid shorthand property initializer." +- name: UNEXPECTED_ARROWPARAM_ELEMENT + id: 148 + message: "Unexpected ArrowParameter element." -- name: RETURN_WITH_VALUE - id: 287 - message: "Unexpected return value." +- name: UNEXPECTED_CHAR_ETSNOLINT + id: 277 + message: "Unexpected character for ETSNOLINT argument! [VALID ONLY: a-z, '-']." -- name: INVALID_INIT_IN_PACKAGE - id: 288 - message: "Non-constant initializer of Package should be apply in Initializer Block." +- name: UNEXPECTED_CHAR_PRIVATE_IDENTIFIER + id: 270 + message: "Unexpected character in private identifier." -- name: PACKAGE_MULTIPLE_STATIC_BLOCK - id: 289 - message: "static block cannot apply to multi-files for one package" +- name: UNEXPECTED_DEFAULT + id: 235 + message: "Unexpected token 'default'. Only declarations are allowed after 'export default'." -- name: CONSTANT_MULTI_INITIALIZED_IN_STATIC_BLOCK - id: 290 - message: "package constant property initialization can only be applied once in static block" +- name: UNEXPECTED_ID + id: 45 + message: "Unexpected identifier." -- name: INVALID_PACKAGE_TOP_LEVEL_STMT - id: 291 - message: "Invalid package toplevel statement" +- name: UNEXPECTED_MODIFIER + id: 153 + message: "Unexpected modifier." -- name: ONLY_CONSTANT_ALLOWED - id: 292 - message: "Only constant expression is expected in the field" +- name: UNEXPECTED_PRIVATE + id: 47 + message: "Unexpected private identifier." -- name: ENUM_OR_ANNOTATION_DIVIDE_BY_ZERO - id: 293 - message: "Division by zero are not allowed in Enum or Annotation" +- name: UNEXPECTED_STRICT_MODE_RESERVED_KEYWORD + id: 264 + message: "Unexpected strict mode reserved keyword." -- name: MISSING_INIT_FOR_CONST_PACKAGE_PROP - id: 294 - message: "Missing initialization for const package property" +- name: UNEXPECTED_SUPER + id: 61 + message: "Unexpected super keyword." -- name: PREDEFINED_TYPE_AS_IDENTIFIER - id: 295 - message: "{} is a predefined type, cannot be used as an identifier" +- name: UNEXPECTED_THIS + id: 240 + message: "Unexpected 'this' keyword in non-receiver context." -- name: EXPORT_WITHOUT_DECLARE_IN_DECL_MODULE - id: 296 - message: "Export keyword without declare shouldn't be used in declaration module." +- name: UNEXPECTED_TOKEN + id: 16 + message: "Unexpected token." -- name: ERROR_ARKTS_NO_VAR - id: 297 - message: "'var' keyword is not supported. Use 'let' instead." +- name: UNEXPECTED_TOKEN_AS + id: 95 + message: "Unexpected token, expected 'as'." -- name: ERROR_ARKTS_NO_PRIVATE_IDENTIFIERS - id: 298 - message: "Use 'private' keyword to declare an identifier as private." +- name: UNEXPECTED_TOKEN_ENUM + id: 178 + message: "Unexpected token in enum member." -- name: ERROR_ARKTS_NO_DEBUGGER_STATEMENT - id: 299 - message: "Debugger statement is not supported!" +- name: UNEXPECTED_TOKEN_EXPECTED_BACKTICK_OR_DOLLAR_LBRACE + id: 259 + message: "Unexpected token, expected '${' or '`'" -- name: MISSING_LOOP_BODY - id: 300 - message: "Missing body in {} statement" +- name: UNEXPECTED_TOKEN_EXPECTED_PARAM + id: 228 + message: "Unexpected token, expected '{}'." -- name: MISSING_LOOP_CONDITION - id: 301 - message: "Missing condition in {} statement" +- name: UNEXPECTED_TOKEN_EXPECTED_PARAM_OR_PARAM + id: 229 + message: "Unexpected token, expected '{}' or '{}'." -- name: PRIVATE_FIELD_MISMATCH - id: 302 - message: "Private field '{}' must be declared in an enclosing class" +- name: UNEXPECTED_TOKEN_FOR_PARAM + id: 187 + message: "Unexpected '?' for parameter." -- name: STATIC_LATE_INITIALIZATION_FIELD_INVALID_MODIFIER - id: 303 - message: "Late-initialized field cannot be defined as static." +- name: UNEXPECTED_TOKEN_ID + id: 112 + message: "Unexpected token, expected an identifier." -- name: LATE_INITIALIZATION_FIELD_HAS_DEFAULT_VALUE - id: 304 - message: "Late-initialized field cannot have default value." +- name: UNEXPECTED_TOKEN_ID_FUN + id: 147 + message: "Unexpected token, expected function identifier." -- name: DEEP_NESTING - id: 305 - message: "Maximum allowed nesting level exceeded." +- name: UNEXPECTED_TOKEN_IN_PRIVATE + id: 160 + message: "Unexpected token in private field." -- name: OPTIONAL_VARIABLE - id: 306 - message: "Optional variable is deprecated and no longer supported." +- name: UNEXPECTED_TOKEN_PARAM + id: 227 + message: "Unexpected token '{}'." -- name: ERROR_ARKTS_NO_EXPORT_ASSIGNMENT - id: 307 - message: "'export = ...' syntax is not supported, use regular import/export instead!" +- name: UNEXPECTED_TOKEN_PARAM_EXPECTED_CASE_OR_DEFAULT + id: 231 + message: "Unexpected token '{}', expected 'case' or 'default'." -- name: ERROR_ARKTS_NO_AMBIENT_DECLS - id: 308 - message: "Ambient module declaration is not supported!" +- name: UNEXPECTED_TOKEN_PRIVATE_ID + id: 124 + message: "Unexpected token, expected 'private' or identifier." -- name: TYPEOF_IN_ANNOTATION - id: 309 - message: "Result of 'typeof' operator is not supported to be used as type annotation." +- name: UNEXPECTED_TOKEN_STRING_LITERAL + id: 151 + message: "Unexpected token, expected string literal." -- name: WRONG_LEFT_OF_INSTANCEOF - id: 310 - message: "The left operand of 'instanceof' operator cannot be a type." +- name: UNEXPECTED_TOKEN_WHILE + id: 170 + message: "Unexpected token, expected 'while'." -- name: AS_CONST_USAGE - id: 311 - message: "'as const' assertion is not supported." +- name: UNHANDLED_THROW_IN_INITIALIZER + id: 243 + message: "Unhandled throw statement." -- name: ERROR_ARKTS_NO_REQUIRE - id: 312 - message: "Importing by 'require' and 'import' assignment is not supported, use 'import * as ... from ...' form instead!" +- name: UNSUPPORTED_CHAR_LIT + id: 261 + message: "Unsupported character literal." -- name: ERROR_ARKTS_NO_IMPORT_ASSERTIONS - id: 313 - message: "Import assertion is not supported, please use the ordinary import syntax instead!" +- name: UNSUPPORTED_ENUM_TYPE + id: 327 + message: "Unsupported enum type annotation. Supported enum types are: int, long or double. String is allowed for literal + types, not annotations." -- name: GENERATOR_FUNCTION - id: 314 - message: "Generator functions are not supported, please use async/await mechanism for multitasking" +- name: UNSUPPORTED_OPERATOR_FOR_STRING + id: 274 + message: "Unsupported operator for String." -- name: LITERAL_VALUE_IDENT - id: 315 - message: "Number, string or computed value property name '{}' is not allowed, use classes to access data by property names that are identifiers" +- name: UNTERMINATED_MULTI_LINE_COMMENT + id: 245 + message: "Unterminated multi-line comment." -- name: HARD_KEYWORD_IDENT - id: 316 - message: "Hard keyword '{}' cannot be used as identifier" +- name: UNTERMINATED_REGEX + id: 260 + message: "Unterminated RegExp." -- name: NOT_AS_OBJECT - id: 318 - message: "{} cannot be used as object." +- name: UNTERMINATED_STRING + id: 253 + message: "Unterminated string." -- name: FIELD_IN_PARAM - id: 319 - message: "Declaring fields in parameter list is not supported" +- name: UNTERMINATED_UNICODE_PROP_ESCAPE + id: 86 + message: "Unterminated Unicode property escape." -- name: FUNC_EXPR - id: 320 - message: "Function expressions are not supported, use arrow functions instead" +- name: USING_RESERVED_NAME_AS_VARIABLE_OR_TYPE_NAME + id: 242 + message: "'{}' is reserved and cannot be used as a variable/type name" -- name: ONLY_STRING_LITERAL_IN_INIT_MODULE - id: 321 - message: "initModule() only accept string literal as argument." +- name: VALUE_IS_NOT_SET + id: 128 + message: "You didn't set the value." -- name: INIT_MODULE_DECLARATION_POSITION - id: 322 - message: "initModule() must only be called immediately after the import statement, and before any other declarations or statements." +- name: VARIANCE_NOD_ALLOWED + id: 98 + message: "Variance modifier is not allowed here." -- name: OVERLOAD_MODIFIERS - id: 323 - message: "Overload Declaration only allow use modifier 'static' | 'async'." +- name: VAR_DEC_EXPECTED + id: 126 + message: "Variable declaration expected." -- name: CLASS_INTERFACE_METHOD_OVERLOADED_NAME_MUST_IDENT - id: 324 - message: "The overloaded method name in class/interface method overload declaration must be identifier." +- name: WITH_DEPRECATED + id: 161 + message: "'With' is deprecated and not supported any more." -- name: FUNCTION_OVERLOADED_NAME_MUST_QUALIFIED_NAME - id: 325 - message: "The overloaded method name in function overload declaration must be qualified name." +- name: WRONG_LEFT_OF_INSTANCEOF + id: 310 + message: "The left operand of 'instanceof' operator cannot be a type." -- name: MORE_INDEXER - id: 326 - message: "Only one index signature can exist in a class" +- name: YIELD_IN_ARROW_FUN_PARAM + id: 66 + message: "yield is not allowed in arrow function parameters." -- name: UNSUPPORTED_ENUM_TYPE - id: 327 - message: "Unsupported enum type annotation. Supported enum types are: int, long or double. String is allowed for literal types, not annotations." +- name: YIELD_IN_GENERATOR_PARAM + id: 54 + message: "Yield is not allowed in generator parameters." + +graveyard: +- 317 +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. diff --git a/ets2panda/util/diagnostic/warning.yaml b/ets2panda/util/diagnostic/warning.yaml index e8164fa885..71701fcf70 100644 --- a/ets2panda/util/diagnostic/warning.yaml +++ b/ets2panda/util/diagnostic/warning.yaml @@ -12,98 +12,107 @@ # limitations under the License. warning: -- name: SUGGEST_FINAL_MODIFIER_FOR_CLASS - id: 1 - message: "Suggest 'final' modifier for class." -- name: SUGGEST_FINAL_MODIFIER_FOR_METHOD - id: 2 - message: "Suggest 'final' modifier for method." +- name: ANNOTATION_UNUSED_GENERIC_ALIAS_WARN + id: 9 + message: "Type alias generic parameter '{}' is not used in type annotation" -- name: PROHIBIT_TOP_LEVEL_STATEMENTS - id: 3 - message: "Prohibit top-level statements." +- name: ASSIGN_TO_READONLY + id: 16 + message: "Cannot assign to '{}' because it is a read-only property." - name: BOOST_EQUALITY_STATEMENT id: 4 message: "Boost Equality Statement. Change sides of binary expression." -- name: REPLACE_ASYNC_FUNCTION_WITH_COROUTINE - id: 5 - message: "Replace asynchronous function with coroutine." +- name: DUPLICATE_SIGS + id: 12 + message: "Detect duplicate signatures, use '{}{}' to replace" -- name: REPLACE_LAMBDA_FUNCTION_WITH_REGULAR_FUNCTION - id: 6 - message: "Replace the lambda function with a regular function." +- name: EXTENSION_MISMATCH + id: 25 + message: "Not matching extensions! Sourcefile: {}, Manual(used): {}" + +- name: EXTENSION_NONPUBLIC_COLLISION + id: 13 + message: "The extension function '{}' has the same name with non-public method in class {}" + +- name: FINALLY_CANT_COMPLETE + id: 21 + message: "Finally clause cannot complete normally" + +- name: FUNCTION_ASM_SIG_COLLISION + id: 22 + message: "Function {} with this assembly signature already declared." + +- name: GETTER_LOOP + id: 23 + message: "Reading the value of the property inside its getter may lead to an endless loop." - name: IMPLICIT_BOXING_TO id: 7 message: "Implicit Boxing to {}{}." -- name : IMPLICIT_UNBOXING_TO +- name: IMPLICIT_UNBOXING_TO id: 8 message: "Implicit Unboxing to {}{}." -- name : ANNOTATION_UNUSED_GENERIC_ALIAS_WARN - id: 9 - message: "Type alias generic parameter '{}' is not used in type annotation" - -- name: NO_OHMURL - id: 11 - message: "'ohmUrl' for module '{}' wasn't specified" - -- name: DUPLICATE_SIGS - id: 12 - message: "Detect duplicate signatures, use '{}{}' to replace" - -- name: EXTENSION_NONPUBLIC_COLLISION - id: 13 - message: "The extension function '{}' has the same name with non-public method in class {}" - -- name: NULLISH_OPERAND - id: 14 - message: "Bad operand type, the operand of the non-nullish expression is 'null' or 'undefined'." +- name: IMPROPER_NUMERIC_CAST + id: 29 + message: "'As' expression for cast is deprecated for numeric types. Use explicit conversion function {}.to{}(...) instead." - name: INSTANCEOF_ERASED id: 15 message: "Type parameter is erased from type '{}' when used in instanceof expression." -- name: ASSIGN_TO_READONLY - id: 16 - message: "Cannot assign to '{}' because it is a read-only property." +- name: MAYBE_FALLTHROUGH + id: 20 + message: "Possible fall-through into case" - name: MAYBE_REASSIGNED id: 17 message: "{} '{}' might already have been assigned." -- name: MAYBE_FALLTHROUGH - id: 20 - message: "Possible fall-through into case" +- name: NO_OHMURL + id: 11 + message: "'ohmUrl' for module '{}' wasn't specified" -- name: FINALLY_CANT_COMPLETE - id: 21 - message: "Finally clause cannot complete normally" +- name: NULLISH_OPERAND + id: 14 + message: "Bad operand type, the operand of the non-nullish expression is 'null' or 'undefined'." -- name: FUNCTION_ASM_SIG_COLLISION - id: 22 - message: "Function {} with this assembly signature already declared." +- name: PROHIBIT_TOP_LEVEL_STATEMENTS + id: 3 + message: "Prohibit top-level statements." -- name: GETTER_LOOP - id: 23 - message: "Reading the value of the property inside its getter may lead to an endless loop." +- name: REPLACE_ASYNC_FUNCTION_WITH_COROUTINE + id: 5 + message: "Replace asynchronous function with coroutine." + +- name: REPLACE_LAMBDA_FUNCTION_WITH_REGULAR_FUNCTION + id: 6 + message: "Replace the lambda function with a regular function." - name: SETTER_LOOP id: 24 message: "Assigning new value to the property inside its setter may lead to an endless loop." -- name: EXTENSION_MISMATCH - id: 25 - message: "Not matching extensions! Sourcefile: {}, Manual(used): {}" +- name: SUGGEST_FINAL_MODIFIER_FOR_CLASS + id: 1 + message: "Suggest 'final' modifier for class." + +- name: SUGGEST_FINAL_MODIFIER_FOR_METHOD + id: 2 + message: "Suggest 'final' modifier for method." - name: UNREACHABLE_STMT id: 26 message: "Unreachable statement." -- name: IMPROPER_NUMERIC_CAST - id: 29 - message: "'As' expression for cast is deprecated for numeric types. Use explicit conversion function {}.to{}(...) instead." +graveyard: +- 10 +- 18 +- 19 +- 27 +- 28 +# See ets_frontend/ets2panda/util/diagnostic/README.md before contributing. -- Gitee