2 * Copyright (c) 2015, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
11 Please change the error map file if you have changed the error codes.
12 The file is at hphp/hack/test/errors/error_map.ml
15 (*****************************************************************************)
17 * Each error has a unique number associated with it. The following modules
18 * define the error code associated with each kind of error.
19 * It is ok to extend the codes with new values, it is NOT OK to change the
20 * value of an existing error to a different error code!
21 * I added some comments to make that extra clear :-)
23 (*****************************************************************************)
25 (* Errors in the Temporary range are for errors that will disappear in the
27 module Temporary
= struct
28 let darray_not_supported = 1
30 let varray_not_supported = 2
32 (* DEPRECATED let unknown_fields_not_supported = 3 *)
33 let varray_or_darray_not_supported = 4
35 (* DEPRECATED let goto_not_supported = 5 *)
36 let nonnull_not_supported = 6
39 module Parsing
= struct
41 | FixmeFormat
[@value 1001]
43 | UnexpectedEofDEPRECATED
44 | UnterminatedCommentDEPRECATED
45 | UnterminatedXhpCommentDEPRECATED
46 | CallTimePassByReferenceDEPRECATED
47 | XhpParsingError
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
48 [@@deriving enum
, show
{ with_path
= false }]
50 let err_code = to_enum
53 module Naming
= struct
55 | AddATypehint
[@value 2001]
56 | TypeparamAlokDEPRECATED
58 | PrimitiveInvalidAlias
59 | CyclicConstraintDEPRECATED
61 | DifferentScopeDEPRECATED
63 | DoubleInsteadOfFloatDEPRECATED
64 | DynamicClassDEPRECATED
66 | ErrorNameAlreadyBound
70 | GenArrayRecArityDEPRECATED
71 | GenArrayVaRecArityDEPRECATED
73 | GenericClassVarDEPRECATED
74 | GenvaArityDEPRECATED
82 | IntegerInsteadOfIntDEPRECATED
84 | InvalidReqImplements
85 | LocalConstDEPRECATED
87 | MethodNameAlreadyBound
91 | NamingTooFewArguments
92 | NamingTooManyArguments
94 | RealInsteadOfFloatDEPRECATED
99 | ThisHintOutsideClass
102 | TypedefConstraintDEPRECATED
111 | NullsafePropertyAccessDEPRECATED
113 | ShapeTypehintDEPRECATED
114 | DynamicNewInStrictMode
115 | InvalidTypeAccessRoot
116 | DuplicateUserAttribute
118 | UnexpectedTypeArguments
119 | TooManyTypeArguments
121 | InvalidInstanceofDEPRECATED
124 | IllegalMemberVariableClass
125 | TooFewTypeArguments
126 | GotoLabelAlreadyDefined
128 | GotoLabelDefinedInFinally
129 | GotoInvokedInFinally
130 | DynamicClassPropertyNameInStrictModeDEPRECATED
131 | ThisAsLexicalVariable
132 | DynamicClassNameInStrictMode
133 | XhpOptionalRequiredAttr
134 | XhpRequiredWithDefault
135 | VariableVariablesDisallowedDEPRECATED
136 | ArrayTypehintsDisallowed
137 | ArrayLiteralsDisallowed
139 | AttributeClassNameConflict
140 | MethodNeedsVisibility
141 | ReferenceInStrictModeDEPRECATED
142 | ReferenceInRxDEPRECATED
143 | DeclareStatementDEPRECATED
144 | MisplacedRxOfScopeDEPRECATED
145 | RxOfScopeAndExplicitRxDEPRECATED
146 | UnsupportedFeatureDEPRECATED
147 | TraitInterfaceConstructorPromoDEPRECATED
148 | NonstaticPropertyWithLSB
149 | ReferenceInAnonUseClauseDEPRECATED
150 | RxMoveInvalidLocation
151 | MisplacedMutabilityHint
152 | MutabilityHintInNonRx
153 | InvalidReturnMutableHint
154 | NoTparamsOnTypeConstsDEPRECATED
155 | PocketUniversesDuplication
156 | UnsupportedTraitUseAs
157 | UnsupportedInsteadOf
158 | InvalidTraitUseAsVisibility
160 | IllegalUseOfDynamicallyCallable
161 | PocketUniversesNotInClass
162 | PocketUniversesAtomMissing
163 | PocketUniversesAtomUnknown
164 | PocketUniversesLocalization
165 | ClassMethNonFinalSelf
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
166 [@@deriving enum
, show
{ with_path
= false }]
168 let err_code = to_enum
171 module NastCheck
= struct
173 | AbstractBody
[@value 3001]
175 | AwaitInSyncFunction
179 | DangerousMethodNameDEPRECATED
181 | InterfaceWithMemberVariable
182 | InterfaceWithStaticMemberVariable
186 | NotAbstractWithoutBody
192 | ToStringReturnsString
197 | IllegalFunctionName
198 | NotAbstractWithoutTypeconst
199 | TypeconstDependsOnExternalTparam
200 | TypeconstAssignedTparamDEPRECATED
201 | AbstractWithTypeconstDEPRECATED
202 | ConstructorRequired
203 | InterfaceWithPartialTypeconst
204 | MultipleXhpCategory
205 | OptionalShapeFieldsNotSupportedDEPRECATED
206 | AwaitNotAllowedDEPRECATED
207 | AsyncInInterfaceDEPRECATED
210 | SuspendOutsideOfCoroutine
212 | BreakContinueNNotSupportedDEPRECATED
213 | StaticMemoizedFunction
214 | InoutParamsInCoroutine
216 | InoutParamsMixByrefDEPRECATED
218 | InoutParamsRetByRefDEPRECATED
220 | ConstAttributeProhibitedDEPRECATED
221 | RetiredError3049DEPRECATED
222 | InoutArgumentBadExpr
223 | MutableParamsOutsideOfSyncDEPRECATED
224 | MutableAsyncMethodDEPRECATED
225 | MutableMethodsMustBeReactive
226 | MutableAttributeOnFunction
227 | MutableReturnAnnotatedDeclsMustBeReactive
229 | ConditionallyReactiveFunctionDEPRECATED
230 | MultipleConditionallyReactiveAnnotations
231 | ConditionallyReactiveAnnotationInvalidArguments
232 | MissingReactivityForConditionDEPRECATED
233 | MultipleReactivityAnnotationsDEPRECATED
234 | RxIsEnabledInvalidLocation
235 | MaybeRxInvalidLocation
236 | NoOnlyrxIfRxfuncForRxIfArgs
237 | CoroutineInConstructor
238 | IllegalReturnByRefDEPRECATED
239 | IllegalByRefExprDEPRECATED
240 | VariadicByRefParamDEPRECATED
241 | MaybeMutableAttributeOnFunction
242 | ConflictingMutableAndMaybeMutableAttributes
243 | MaybeMutableMethodsMustBeReactive
246 | NonstaticMethodInAbstractFinalClass
247 | MutableOnStaticDEPRECATED
248 | ClassnameConstInstanceOfDEPRECATED
249 | ByRefParamOnConstructDEPRECATED
250 | ByRefDynamicCallDEPRECATED
251 | ByRefPropertyDEPRECATED
252 | ByRefCallDEPRECATED
253 | SwitchNonTerminalDefault
254 | SwitchMultipleDefault
255 | RepeatedRecordFieldName
256 | PhpLambdaDisallowed
257 | EntryPointArguments
258 | VariadicMemoize
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
259 [@@deriving enum
, show
{ with_path
= false }]
261 let err_code = to_enum
264 module Typing
= struct
266 | AbstractClassFinalDEPRECATED
[@value 4001]
267 | UninstantiableClass
268 | AnonymousRecursiveDEPRECATED
269 | AnonymousRecursiveCallDEPRECATED
275 | ClassArityDEPRECATED
282 | DynamicYieldPrivateDEPRECATED
283 | EnumConstantTypeBad
284 | EnumSwitchNonexhaustive
286 | EnumSwitchRedundant
287 | EnumSwitchRedundantDefault
288 | EnumSwitchWrongClass
290 | EnumTypeTypedefMixedDEPRECATED
292 | ExpectedLiteralFormatString
293 | ExpectedStaticIntDEPRECATED
295 | ExpectingReturnTypeHint
296 | ExpectingReturnTypeHintSuggestDEPRECATED
298 | ExpectingTypeHintVariadic
299 | RetiredError4034DEPRECATED
302 | FieldMissingDEPRECATED
307 | FunUnexpectedNonvariadic
308 | FunVariadicityHhVsPhp56
309 | GenaExpectsArrayDEPRECATED
313 | InterfaceFinalDEPRECATED
314 | InvalidShapeFieldConst
315 | InvalidShapeFieldLiteral
316 | InvalidShapeFieldName
317 | InvalidShapeFieldType
319 | MemberNotImplemented
323 | NegativeTupleIndexDEPRECATED
325 | NewStaticInconsistent
327 | NonObjectMemberRead
330 | NullableParameterDEPRECATED
331 | OptionReturnOnlyTypehint
337 | PairArityDEPRECATED
350 | ShapeFieldClassMismatch
351 | ShapeFieldTypeMismatch
353 | SketchyNullCheckDEPRECATED
354 | SketchyNullCheckPrimitiveDEPRECATED
357 | StaticOverflowDEPRECATED
358 | RetiredError4093DEPRECATED
359 | ThisInStaticDEPRECATED
360 | ThisVarOutsideClass
361 | TraitFinalDEPRECATED
362 | TupleArityDEPRECATED
363 | TupleArityMismatchDEPRECATED
364 | TupleIndexTooLargeDEPRECATED
367 | TypeParamArityDEPRECATED
368 | RetiredError4103DEPRECATED
379 | VoidParameterDEPRECATED
386 | DeclaredContravariant
387 | UnsetInStrictDEPRECATED
388 | StrictMembersNotKnown
389 | ErasedGenericAtRuntime
390 | DynamicClassDEPRECATED
391 | AttributeTooManyArguments
395 | CannotDeclareConstant
397 | NullsafePropertyWriteContext
399 | ThisLvalueDEPRECATED
400 | UnsetNonidxInStrict
401 | InvalidShapeFieldNameEmpty
402 | InvalidShapeFieldNameNumberDEPRECATED
404 | InvalidShapeRemoveKey
405 | MissingOptionalFieldDEPRECATED
407 | AbstractConcreteOverride
408 | LocalVariableModifedAndUsed
409 | LocalVariableModifedTwice
411 | CyclicEnumConstraint
412 | UnpackingDisallowed
414 | InvalidMemoizedParam
415 | IllegalTypeStructure
416 | NotNullableCompareNullTrivial
417 | ClassPropertyOnlyStaticLiteralDEPRECATED
418 | AttributeTooFewArguments
419 | ReferenceExprDEPRECATED
422 | EqIncompatibleTypes
424 | InstanceofAlwaysFalseDEPRECATED
425 | InstanceofAlwaysTrueDEPRECATED
427 | InstanceofGenericClassnameDEPRECATED
428 | RequiredFieldIsOptional
430 | ArrayGetWithOptionalField
431 | UnknownFieldDisallowedInShape
433 | PassByRefAnnotationMissingDEPRECATED
434 | NonCallArgumentInSuspend
435 | NonCoroutineCallInSuspend
436 | CoroutineCallOutsideOfSuspend
437 | FunctionIsNotCoroutine
438 | CoroutinnessMismatch
439 | ExpectingAwaitableReturnTypeHint
440 | ReffinessInvariantDEPRECATED
442 | StaticMethodOnInterfaceDEPRECATED
446 | PassByRefAnnotationUnexpectedDEPRECATED
447 | InoutAnnotationMissing
448 | InoutAnnotationUnexpected
450 | StaticSyntheticMethod
452 | InvalidNewDisposable
453 | EscapingDisposableParameter
454 | AcceptDisposableInvariant
455 | InvalidDisposableHint
459 | MustExtendDisposable
460 | InvalidIsAsExpressionHint
463 | ParentConstSelfNotDEPRECATED
464 | PartiallyValidIsAsExpressionHintDEPRECATED
465 | NonreactiveFunctionCall
466 | NonreactiveIndexing
468 | FunReactivityMismatch
469 | OverridingPropConstMismatch
470 | InvalidReturnDisposable
471 | InvalidDisposableReturnHint
472 | ReturnDisposableMismatch
473 | InoutArgumentBadType
474 | InconsistentUnsetDEPRECATED
476 | InvalidFreezeTarget
478 | FreezeInNonreactiveContext
479 | MutableCallOnImmutable
480 | MutableArgumentMismatch
481 | InvalidMutableReturnResult
482 | MutableReturnResultMismatch
483 | NonreactiveCallFromShallow
484 | EnumTypeTypedefNonnull
485 | RxEnabledInNonRxContext
486 | RxEnabledInLambdasDEPRECATED
489 | UntypedLambdaStrictMode
490 | BindingRefInArrayDEPRECATED
491 | EchoInReactiveContext
492 | SuperglobalInReactiveContext
493 | StaticPropertyInReactiveContext
494 | StaticInReactiveContextDEPRECATED
495 | GlobalInReactiveContextDEPRECATED
496 | WrongExpressionKindAttribute
497 | AttributeClassNoConstructorArgsDEPRECATED
498 | InvalidTypeForOnlyrxIfRxfuncParameter
499 | MissingAnnotationForOnlyrxIfRxfuncParameter
500 | CannotReturnBorrowedValueAsImmutable
501 | DeclOverrideMissingHint
502 | InvalidConditionallyReactiveCall
504 | SealedFinalDEPRECATED
505 | ComparisonInvalidTypes
506 | OptionVoidDEPRECATED
507 | MutableInNonreactiveContext
508 | InvalidArgumentOfRxMutableFunction
509 | LetVarImmutabilityViolation
510 | UnsealableDEPRECATED
511 | ReturnVoidToRxMismatch
512 | ReturnsVoidToRxAsNonExpressionStatement
513 | NonawaitedAwaitableInReactiveContext
514 | ShapesKeyExistsAlwaysTrue
515 | ShapesKeyExistsAlwaysFalse
516 | ShapesMethodAccessWithNonExistentField
518 | PassingArrayCellByRefDEPRECATED
519 | CallSiteReactivityMismatch
520 | RxParameterConditionMismatch
521 | AmbiguousObjectAccess
523 | ReassignMaybeMutableVar
524 | MaybeMutableArgumentMismatch
525 | ImmutableArgumentMismatch
526 | ImmutableCallOnMutable
527 | InvalidCallMaybeMutable
530 | InvalidPPLStaticCall
531 | TypeTestInLambdaDEPRECATED
532 | InvalidTraversableInRx
533 | ReassignMutableThis
534 | MutableExpressionAsMultipleMutableArguments
535 | InvalidUnsetTargetInRx
536 | CoroutineOutsideExperimental
538 | InvalidTruthinessTestDEPRECATED
539 | RePrefixedNonString
541 | SketchyTruthinessTestDEPRECATED
542 | LateInitWithDefault
544 | ClassVarTypeGenericParam
545 | InvalidSwitchCaseValueType
547 | BadLateInitOverride
548 | EscapingMutableObject
550 | MultipleConcreteDefs
551 | MoveInNonreactiveContext
554 | IgnoredResultOfFreezeDEPRECATED
555 | IgnoredResultOfMoveDEPRECATED
558 | InconsistentMutability
559 | InvalidMutabilityFlavorInAssignment
561 | UnknownObjectMember
563 | InvalidArrayKeyRead
564 | ReferenceExprNotFunctionArgDEPRECATED
565 | RedundantRxCondition
566 | RedeclaringMissingMethod
567 | InvalidEnforceableTypeArgument
570 | InvalidReifiedArgument
572 | InvalidNewableTypeArgument
573 | InvalidNewableTypeParamConstraints
575 | NewStaticClassReified
577 | ConsistentConstructReified
579 | MissingXhpRequiredAttr
580 | BadXhpAttrRequiredOverride
581 | ReifiedTparamVariadicDEPRECATED
582 | UnresolvedTypeVariable
584 | InvalidArrayKeyConstraint
585 | OverrideNoDefaultTypeconst
586 | ShapeAccessWithNonExistentField
587 | DisallowPHPArraysAttr
588 | TypeConstraintViolation
591 | TypeConstantMismatch
592 | TypeConstantRedeclarationDEPRECATED
593 | ConstantDoesNotMatchEnumType
594 | EnumConstraintMustBeArraykey
595 | EnumSubtypeMustHaveCompatibleConstraint
596 | ParameterDefaultValueWrongType
597 | NewtypeAliasMustSatisfyConstraint
601 | MissingReturnInNonVoidFunction
602 | InoutReturnTypeMismatch
603 | ClassConstantValueDoesNotMatchHint
604 | ClassPropertyInitializerTypeDoesNotMatchHint
608 | XhpAttributeValueDoesNotMatchHint
609 | TraitPropConstClass
610 | EnumUnderlyingTypeMustBeArraykey
612 | RequireGenericExplicit
613 | ClassConstantTypeMismatch
614 | PocketUniversesExpansion
615 | PocketUniversesTyping
616 | RecordInitValueDoesNotMatchHint
617 | AbstractTconstNotAllowed
619 | RecordMissingRequiredField
623 | StaticCallWithClassLevelReifiedGeneric
627 | InvalidReifiedFunctionPointer
628 | BadFunctionPointerConstruction
630 | TraitReuseInsideClass
632 | PocketUniversesInvalidUpperBounds
633 | PocketUniversesRefinement
634 | PocketUniversesReservedSyntax
636 | InvalidArrayKeyWrite
638 | NonObjectMemberWrite
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
639 [@@deriving enum
, show
{ with_path
= false }]
641 let err_code = to_enum
644 (* 5xxx: reserved for FB lint *)
645 (* 6xxx: reserved for FB ai *)
646 (* 7xxx: reserved for FB ai *)
650 | ForwardCompatibilityNotCurrent
[@value 8001]
651 | ForwardCompatibilityBelowMinimum
652 [@@deriving enum
, show
{ with_path
= false }]
654 let err_code = to_enum
657 (* 9xxx: reserved for FB ai *)
658 (* 10xxx: reserved for FB ai *)