13af6ab5fSopenharmony_ci/*
23af6ab5fSopenharmony_ci * Copyright (c) 2023-2024 Huawei Device Co., Ltd.
33af6ab5fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
43af6ab5fSopenharmony_ci * you may not use this file except in compliance with the License.
53af6ab5fSopenharmony_ci * You may obtain a copy of the License at
63af6ab5fSopenharmony_ci *
73af6ab5fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
83af6ab5fSopenharmony_ci *
93af6ab5fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
103af6ab5fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
113af6ab5fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123af6ab5fSopenharmony_ci * See the License for the specific language governing permissions and
133af6ab5fSopenharmony_ci * limitations under the License.
143af6ab5fSopenharmony_ci */
153af6ab5fSopenharmony_ci
163af6ab5fSopenharmony_ciimport { FaultID } from './Problems';
173af6ab5fSopenharmony_ci
183af6ab5fSopenharmony_ciexport const faultDesc: string[] = [];
193af6ab5fSopenharmony_ci
203af6ab5fSopenharmony_cifaultDesc[FaultID.AnyType] = '"any" type';
213af6ab5fSopenharmony_cifaultDesc[FaultID.SymbolType] = '"symbol" type';
223af6ab5fSopenharmony_cifaultDesc[FaultID.ObjectLiteralNoContextType] = 'Object literals with no context Class or Interface type';
233af6ab5fSopenharmony_cifaultDesc[FaultID.ArrayLiteralNoContextType] = 'Array literals with no context Array type';
243af6ab5fSopenharmony_cifaultDesc[FaultID.ComputedPropertyName] = 'Computed properties';
253af6ab5fSopenharmony_cifaultDesc[FaultID.LiteralAsPropertyName] = 'String or integer literal as property name';
263af6ab5fSopenharmony_cifaultDesc[FaultID.TypeQuery] = '"typeof" operations';
273af6ab5fSopenharmony_cifaultDesc[FaultID.IsOperator] = '"is" operations';
283af6ab5fSopenharmony_cifaultDesc[FaultID.DestructuringParameter] = 'destructuring parameters';
293af6ab5fSopenharmony_cifaultDesc[FaultID.YieldExpression] = '"yield" operations';
303af6ab5fSopenharmony_cifaultDesc[FaultID.InterfaceMerging] = 'merging interfaces';
313af6ab5fSopenharmony_cifaultDesc[FaultID.EnumMerging] = 'merging enums';
323af6ab5fSopenharmony_cifaultDesc[FaultID.InterfaceExtendsClass] = 'interfaces inherited from classes';
333af6ab5fSopenharmony_cifaultDesc[FaultID.IndexMember] = 'index members';
343af6ab5fSopenharmony_cifaultDesc[FaultID.WithStatement] = '"with" statements';
353af6ab5fSopenharmony_cifaultDesc[FaultID.ThrowStatement] = '"throw" statements with expression of wrong type';
363af6ab5fSopenharmony_cifaultDesc[FaultID.IndexedAccessType] = 'Indexed access type';
373af6ab5fSopenharmony_cifaultDesc[FaultID.UnknownType] = '"unknown" type';
383af6ab5fSopenharmony_cifaultDesc[FaultID.ForInStatement] = '"for-In" statements';
393af6ab5fSopenharmony_cifaultDesc[FaultID.InOperator] = '"in" operations';
403af6ab5fSopenharmony_cifaultDesc[FaultID.FunctionExpression] = 'function expressions';
413af6ab5fSopenharmony_cifaultDesc[FaultID.IntersectionType] = 'intersection types and type literals';
423af6ab5fSopenharmony_cifaultDesc[FaultID.ObjectTypeLiteral] = 'Object type literals';
433af6ab5fSopenharmony_cifaultDesc[FaultID.CommaOperator] = 'comma operator';
443af6ab5fSopenharmony_cifaultDesc[FaultID.LimitedReturnTypeInference] = 'Functions with limited return type inference';
453af6ab5fSopenharmony_cifaultDesc[FaultID.ClassExpression] = 'Class expressions';
463af6ab5fSopenharmony_cifaultDesc[FaultID.DestructuringAssignment] = 'Destructuring assignments';
473af6ab5fSopenharmony_cifaultDesc[FaultID.DestructuringDeclaration] = 'Destructuring variable declarations';
483af6ab5fSopenharmony_cifaultDesc[FaultID.VarDeclaration] = '"var" declarations';
493af6ab5fSopenharmony_cifaultDesc[FaultID.CatchWithUnsupportedType] = '"catch" clause with unsupported exception type';
503af6ab5fSopenharmony_cifaultDesc[FaultID.DeleteOperator] = '"delete" operations';
513af6ab5fSopenharmony_cifaultDesc[FaultID.DeclWithDuplicateName] = 'Declarations with duplicate name';
523af6ab5fSopenharmony_cifaultDesc[FaultID.UnaryArithmNotNumber] = 'Unary arithmetics with not-numeric values';
533af6ab5fSopenharmony_cifaultDesc[FaultID.ConstructorType] = 'Constructor type';
543af6ab5fSopenharmony_cifaultDesc[FaultID.ConstructorFuncs] = 'Constructor function type is not supported';
553af6ab5fSopenharmony_cifaultDesc[FaultID.ConstructorIface] = 'Construct signatures are not supported in interfaces';
563af6ab5fSopenharmony_cifaultDesc[FaultID.CallSignature] = 'Call signatures';
573af6ab5fSopenharmony_cifaultDesc[FaultID.TypeAssertion] = 'Type assertion expressions';
583af6ab5fSopenharmony_cifaultDesc[FaultID.PrivateIdentifier] = 'Private identifiers (with "#" prefix)';
593af6ab5fSopenharmony_cifaultDesc[FaultID.LocalFunction] = 'Local function declarations';
603af6ab5fSopenharmony_cifaultDesc[FaultID.ConditionalType] = 'Conditional type';
613af6ab5fSopenharmony_cifaultDesc[FaultID.MappedType] = 'Mapped type';
623af6ab5fSopenharmony_cifaultDesc[FaultID.NamespaceAsObject] = 'Namespaces used as objects';
633af6ab5fSopenharmony_cifaultDesc[FaultID.ClassAsObject] = faultDesc[FaultID.ClassAsObjectError] = 'Class used as object';
643af6ab5fSopenharmony_cifaultDesc[FaultID.NonDeclarationInNamespace] = 'Non-declaration statements in namespaces';
653af6ab5fSopenharmony_cifaultDesc[FaultID.GeneratorFunction] = 'Generator functions';
663af6ab5fSopenharmony_cifaultDesc[FaultID.FunctionContainsThis] = 'Functions containing "this"';
673af6ab5fSopenharmony_cifaultDesc[FaultID.PropertyAccessByIndex] = 'property access by index';
683af6ab5fSopenharmony_cifaultDesc[FaultID.JsxElement] = 'JSX Elements';
693af6ab5fSopenharmony_cifaultDesc[FaultID.EnumMemberNonConstInit] = 'Enum members with non-constant initializer';
703af6ab5fSopenharmony_cifaultDesc[FaultID.ImplementsClass] = 'Class type mentioned in "implements" clause';
713af6ab5fSopenharmony_cifaultDesc[FaultID.MethodReassignment] = 'Access to undefined field';
723af6ab5fSopenharmony_cifaultDesc[FaultID.MultipleStaticBlocks] = 'Multiple static blocks';
733af6ab5fSopenharmony_cifaultDesc[FaultID.ThisType] = '"this" type';
743af6ab5fSopenharmony_cifaultDesc[FaultID.IntefaceExtendDifProps] = 'Extends same properties with different types';
753af6ab5fSopenharmony_cifaultDesc[FaultID.StructuralIdentity] = 'Use of type structural identity';
763af6ab5fSopenharmony_cifaultDesc[FaultID.ExportAssignment] = 'Export assignments (export = ..)';
773af6ab5fSopenharmony_cifaultDesc[FaultID.ImportAssignment] = 'Import assignments (import = ..)';
783af6ab5fSopenharmony_cifaultDesc[FaultID.GenericCallNoTypeArgs] = 'Generic calls without type arguments';
793af6ab5fSopenharmony_cifaultDesc[FaultID.ParameterProperties] = 'Parameter properties in constructor';
803af6ab5fSopenharmony_cifaultDesc[FaultID.InstanceofUnsupported] = 'Left-hand side of "instanceof" is wrong';
813af6ab5fSopenharmony_cifaultDesc[FaultID.ShorthandAmbientModuleDecl] = 'Shorthand ambient module declaration';
823af6ab5fSopenharmony_cifaultDesc[FaultID.WildcardsInModuleName] = 'Wildcards in module name';
833af6ab5fSopenharmony_cifaultDesc[FaultID.UMDModuleDefinition] = 'UMD module definition';
843af6ab5fSopenharmony_cifaultDesc[FaultID.NewTarget] = '"new.target" meta-property';
853af6ab5fSopenharmony_cifaultDesc[FaultID.DefiniteAssignment] = faultDesc[FaultID.DefiniteAssignmentError] = 'Definite assignment assertion';
863af6ab5fSopenharmony_cifaultDesc[FaultID.Prototype] = 'Prototype assignment';
873af6ab5fSopenharmony_cifaultDesc[FaultID.GlobalThis] = faultDesc[FaultID.GlobalThisError] = 'Use of globalThis';
883af6ab5fSopenharmony_cifaultDesc[FaultID.UtilityType] = 'Standard Utility types';
893af6ab5fSopenharmony_cifaultDesc[FaultID.PropertyDeclOnFunction] = 'Property declaration on function';
903af6ab5fSopenharmony_cifaultDesc[FaultID.FunctionApplyCall] = 'Invoking methods of function objects';
913af6ab5fSopenharmony_cifaultDesc[FaultID.FunctionBind] = faultDesc[FaultID.FunctionBindError] = 'Invoking methods of function objects';
923af6ab5fSopenharmony_cifaultDesc[FaultID.ConstAssertion] = '"as const" assertion';
933af6ab5fSopenharmony_cifaultDesc[FaultID.ImportAssertion] = 'Import assertion';
943af6ab5fSopenharmony_cifaultDesc[FaultID.SpreadOperator] = 'Spread operation';
953af6ab5fSopenharmony_cifaultDesc[FaultID.LimitedStdLibApi] = 'Limited standard library API';
963af6ab5fSopenharmony_cifaultDesc[FaultID.ErrorSuppression] = 'Error suppression annotation';
973af6ab5fSopenharmony_cifaultDesc[FaultID.StrictDiagnostic] = 'Strict diagnostic';
983af6ab5fSopenharmony_cifaultDesc[FaultID.ImportAfterStatement] = 'Import declaration after other declaration or statement';
993af6ab5fSopenharmony_cifaultDesc[FaultID.EsObjectType] = faultDesc[FaultID.EsObjectTypeError] = 'Restricted "ESObject" type';
1003af6ab5fSopenharmony_cifaultDesc[FaultID.SendableClassInheritance] = 'Sendable class inheritance';
1013af6ab5fSopenharmony_cifaultDesc[FaultID.SendablePropType] = 'Sendable class property';
1023af6ab5fSopenharmony_cifaultDesc[FaultID.SendableDefiniteAssignment] = 'Use of definite assignment assertion in "Sendable" class';
1033af6ab5fSopenharmony_cifaultDesc[FaultID.SendableGenericTypes] = 'Sendable generic types';
1043af6ab5fSopenharmony_cifaultDesc[FaultID.SendableCapturedVars] = 'Sendable class captured variables';
1053af6ab5fSopenharmony_cifaultDesc[FaultID.SendableClassDecorator] = 'Sendable class decorator';
1063af6ab5fSopenharmony_cifaultDesc[FaultID.SendableObjectInitialization] =
1073af6ab5fSopenharmony_ci  'Object literal or array literal is not allowed to initialize a "Sendable" object';
1083af6ab5fSopenharmony_cifaultDesc[FaultID.SendableComputedPropName] = 'Sendable computed property name';
1093af6ab5fSopenharmony_cifaultDesc[FaultID.SendableAsExpr] = 'Sendable as expr';
1103af6ab5fSopenharmony_cifaultDesc[FaultID.SharedNoSideEffectImport] = 'Shared no side effect import';
1113af6ab5fSopenharmony_cifaultDesc[FaultID.SharedModuleExports] = 'Shared module exports';
1123af6ab5fSopenharmony_cifaultDesc[FaultID.SharedModuleNoWildcardExport] = 'Share module no wildcard export';
1133af6ab5fSopenharmony_cifaultDesc[FaultID.NoTsImportEts] = 'No ts Import Ets';
1143af6ab5fSopenharmony_cifaultDesc[FaultID.SendableTypeInheritance] = 'Sendable type inheritance';
1153af6ab5fSopenharmony_cifaultDesc[FaultID.SendableTypeExported] = 'Sendable type exported';
1163af6ab5fSopenharmony_cifaultDesc[FaultID.NoTsReExportEts] = 'No ts re-export ets';
1173af6ab5fSopenharmony_cifaultDesc[FaultID.NoSIdeEffectImportEtsToTs] = 'No side effect import ets to ts';
1183af6ab5fSopenharmony_cifaultDesc[FaultID.NoNameSpaceImportEtsToTs] = 'No namespace import ets to ts';
1193af6ab5fSopenharmony_cifaultDesc[FaultID.SendableExplicitFieldType] = 'Field in sendable class must have type annotation';
1203af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionImportedVariables] = 'Sendable function imported variables';
1213af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionDecorator] = 'Sendable function decorator';
1223af6ab5fSopenharmony_cifaultDesc[FaultID.SendableTypeAliasDecorator] = 'Sendable typeAlias decorator';
1233af6ab5fSopenharmony_cifaultDesc[FaultID.SendableTypeAliasDeclaration] = 'Sendable typeAlias declaration';
1243af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionAssignment] = 'Sendable function assignment';
1253af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionOverloadDecorator] = 'Sendable function overload decorator';
1263af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionProperty] = 'Sendable function property';
1273af6ab5fSopenharmony_cifaultDesc[FaultID.SendableFunctionAsExpr] = 'Sendable function as expr';
1283af6ab5fSopenharmony_cifaultDesc[FaultID.SendableDecoratorLimited] = 'Sendable decorator limited';
1293af6ab5fSopenharmony_cifaultDesc[FaultID.SendableClosureExport] = 'Sendable closure export';
1303af6ab5fSopenharmony_cifaultDesc[FaultID.SharedModuleExportsWarning] = 'Shared module exports Warning';
1313af6ab5fSopenharmony_cifaultDesc[FaultID.SendableBetaCompatible] = 'Sendable beta compatible';
1323af6ab5fSopenharmony_cifaultDesc[FaultID.ObjectLiteralProperty] = 'Object literal property';
1333af6ab5fSopenharmony_cifaultDesc[FaultID.OptionalMethod] = 'Optional method';
1343af6ab5fSopenharmony_cifaultDesc[FaultID.ImportType] = 'Import type syntax';
1353af6ab5fSopenharmony_cifaultDesc[FaultID.DynamicCtorCall] = 'Dynamic constructor call';
136