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
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
257 [@@deriving enum
, show
{ with_path
= false }]
259 let err_code = to_enum
262 module Typing
= struct
264 | AbstractClassFinalDEPRECATED
[@value 4001]
265 | UninstantiableClass
266 | AnonymousRecursiveDEPRECATED
267 | AnonymousRecursiveCallDEPRECATED
273 | ClassArityDEPRECATED
280 | DynamicYieldPrivateDEPRECATED
281 | EnumConstantTypeBad
282 | EnumSwitchNonexhaustive
284 | EnumSwitchRedundant
285 | EnumSwitchRedundantDefault
286 | EnumSwitchWrongClass
288 | EnumTypeTypedefMixedDEPRECATED
290 | ExpectedLiteralFormatString
291 | ExpectedStaticIntDEPRECATED
293 | ExpectingReturnTypeHint
294 | ExpectingReturnTypeHintSuggestDEPRECATED
296 | ExpectingTypeHintVariadic
297 | RetiredError4034DEPRECATED
300 | FieldMissingDEPRECATED
305 | FunUnexpectedNonvariadic
306 | FunVariadicityHhVsPhp56
307 | GenaExpectsArrayDEPRECATED
311 | InterfaceFinalDEPRECATED
312 | InvalidShapeFieldConst
313 | InvalidShapeFieldLiteral
314 | InvalidShapeFieldName
315 | InvalidShapeFieldType
317 | MemberNotImplemented
321 | NegativeTupleIndexDEPRECATED
323 | NewStaticInconsistent
325 | NonObjectMemberRead
328 | NullableParameterDEPRECATED
329 | OptionReturnOnlyTypehint
335 | PairArityDEPRECATED
348 | ShapeFieldClassMismatch
349 | ShapeFieldTypeMismatch
351 | SketchyNullCheckDEPRECATED
352 | SketchyNullCheckPrimitiveDEPRECATED
355 | StaticOverflowDEPRECATED
356 | RetiredError4093DEPRECATED
357 | ThisInStaticDEPRECATED
358 | ThisVarOutsideClass
359 | TraitFinalDEPRECATED
360 | TupleArityDEPRECATED
361 | TupleArityMismatchDEPRECATED
362 | TupleIndexTooLargeDEPRECATED
365 | TypeParamArityDEPRECATED
366 | RetiredError4103DEPRECATED
377 | VoidParameterDEPRECATED
384 | DeclaredContravariant
385 | UnsetInStrictDEPRECATED
386 | StrictMembersNotKnown
387 | ErasedGenericAtRuntime
388 | DynamicClassDEPRECATED
389 | AttributeTooManyArguments
393 | CannotDeclareConstant
395 | NullsafePropertyWriteContext
397 | ThisLvalueDEPRECATED
398 | UnsetNonidxInStrict
399 | InvalidShapeFieldNameEmpty
400 | InvalidShapeFieldNameNumberDEPRECATED
402 | InvalidShapeRemoveKey
403 | MissingOptionalFieldDEPRECATED
405 | AbstractConcreteOverride
406 | LocalVariableModifedAndUsed
407 | LocalVariableModifedTwice
409 | CyclicEnumConstraint
410 | UnpackingDisallowed
412 | InvalidMemoizedParam
413 | IllegalTypeStructure
414 | NotNullableCompareNullTrivial
415 | ClassPropertyOnlyStaticLiteralDEPRECATED
416 | AttributeTooFewArguments
417 | ReferenceExprDEPRECATED
420 | EqIncompatibleTypes
422 | InstanceofAlwaysFalseDEPRECATED
423 | InstanceofAlwaysTrueDEPRECATED
425 | InstanceofGenericClassnameDEPRECATED
426 | RequiredFieldIsOptional
428 | ArrayGetWithOptionalField
429 | UnknownFieldDisallowedInShape
431 | PassByRefAnnotationMissingDEPRECATED
432 | NonCallArgumentInSuspend
433 | NonCoroutineCallInSuspend
434 | CoroutineCallOutsideOfSuspend
435 | FunctionIsNotCoroutine
436 | CoroutinnessMismatch
437 | ExpectingAwaitableReturnTypeHint
438 | ReffinessInvariantDEPRECATED
440 | StaticMethodOnInterfaceDEPRECATED
444 | PassByRefAnnotationUnexpectedDEPRECATED
445 | InoutAnnotationMissing
446 | InoutAnnotationUnexpected
448 | StaticSyntheticMethod
450 | InvalidNewDisposable
451 | EscapingDisposableParameter
452 | AcceptDisposableInvariant
453 | InvalidDisposableHint
457 | MustExtendDisposable
458 | InvalidIsAsExpressionHint
461 | ParentConstSelfNotDEPRECATED
462 | PartiallyValidIsAsExpressionHintDEPRECATED
463 | NonreactiveFunctionCall
464 | NonreactiveIndexing
466 | FunReactivityMismatch
467 | OverridingPropConstMismatch
468 | InvalidReturnDisposable
469 | InvalidDisposableReturnHint
470 | ReturnDisposableMismatch
471 | InoutArgumentBadType
472 | InconsistentUnsetDEPRECATED
474 | InvalidFreezeTarget
476 | FreezeInNonreactiveContext
477 | MutableCallOnImmutable
478 | MutableArgumentMismatch
479 | InvalidMutableReturnResult
480 | MutableReturnResultMismatch
481 | NonreactiveCallFromShallow
482 | EnumTypeTypedefNonnull
483 | RxEnabledInNonRxContext
484 | RxEnabledInLambdasDEPRECATED
487 | UntypedLambdaStrictMode
488 | BindingRefInArrayDEPRECATED
489 | EchoInReactiveContext
490 | SuperglobalInReactiveContext
491 | StaticPropertyInReactiveContext
492 | StaticInReactiveContextDEPRECATED
493 | GlobalInReactiveContextDEPRECATED
494 | WrongExpressionKindAttribute
495 | AttributeClassNoConstructorArgsDEPRECATED
496 | InvalidTypeForOnlyrxIfRxfuncParameter
497 | MissingAnnotationForOnlyrxIfRxfuncParameter
498 | CannotReturnBorrowedValueAsImmutable
499 | DeclOverrideMissingHint
500 | InvalidConditionallyReactiveCall
502 | SealedFinalDEPRECATED
503 | ComparisonInvalidTypes
504 | OptionVoidDEPRECATED
505 | MutableInNonreactiveContext
506 | InvalidArgumentOfRxMutableFunction
507 | LetVarImmutabilityViolation
508 | UnsealableDEPRECATED
509 | ReturnVoidToRxMismatch
510 | ReturnsVoidToRxAsNonExpressionStatement
511 | NonawaitedAwaitableInReactiveContext
512 | ShapesKeyExistsAlwaysTrue
513 | ShapesKeyExistsAlwaysFalse
514 | ShapesMethodAccessWithNonExistentField
516 | PassingArrayCellByRefDEPRECATED
517 | CallSiteReactivityMismatch
518 | RxParameterConditionMismatch
519 | AmbiguousObjectAccess
521 | ReassignMaybeMutableVar
522 | MaybeMutableArgumentMismatch
523 | ImmutableArgumentMismatch
524 | ImmutableCallOnMutable
525 | InvalidCallMaybeMutable
528 | InvalidPPLStaticCall
529 | TypeTestInLambdaDEPRECATED
530 | InvalidTraversableInRx
531 | ReassignMutableThis
532 | MutableExpressionAsMultipleMutableArguments
533 | InvalidUnsetTargetInRx
534 | CoroutineOutsideExperimental
536 | InvalidTruthinessTestDEPRECATED
537 | RePrefixedNonString
539 | SketchyTruthinessTestDEPRECATED
540 | LateInitWithDefault
542 | ClassVarTypeGenericParam
543 | InvalidSwitchCaseValueType
545 | BadLateInitOverride
546 | EscapingMutableObject
548 | MultipleConcreteDefs
549 | MoveInNonreactiveContext
552 | IgnoredResultOfFreezeDEPRECATED
553 | IgnoredResultOfMoveDEPRECATED
556 | InconsistentMutability
557 | InvalidMutabilityFlavorInAssignment
559 | UnknownObjectMember
561 | InvalidArrayKeyRead
562 | ReferenceExprNotFunctionArgDEPRECATED
563 | RedundantRxCondition
564 | RedeclaringMissingMethod
565 | InvalidEnforceableTypeArgument
568 | InvalidReifiedArgument
570 | InvalidNewableTypeArgument
571 | InvalidNewableTypeParamConstraints
573 | NewStaticClassReified
575 | ConsistentConstructReified
577 | MissingXhpRequiredAttr
578 | BadXhpAttrRequiredOverride
579 | ReifiedTparamVariadicDEPRECATED
580 | UnresolvedTypeVariable
582 | InvalidArrayKeyConstraint
583 | OverrideNoDefaultTypeconst
584 | ShapeAccessWithNonExistentField
585 | DisallowPHPArraysAttr
586 | TypeConstraintViolation
589 | TypeConstantMismatch
590 | TypeConstantRedeclarationDEPRECATED
591 | ConstantDoesNotMatchEnumType
592 | EnumConstraintMustBeArraykey
593 | EnumSubtypeMustHaveCompatibleConstraint
594 | ParameterDefaultValueWrongType
595 | NewtypeAliasMustSatisfyConstraint
599 | MissingReturnInNonVoidFunction
600 | InoutReturnTypeMismatch
601 | ClassConstantValueDoesNotMatchHint
602 | ClassPropertyInitializerTypeDoesNotMatchHint
606 | XhpAttributeValueDoesNotMatchHint
607 | TraitPropConstClass
608 | EnumUnderlyingTypeMustBeArraykey
610 | RequireGenericExplicit
611 | ClassConstantTypeMismatch
612 | PocketUniversesExpansion
613 | PocketUniversesTyping
614 | RecordInitValueDoesNotMatchHint
615 | AbstractTconstNotAllowed
617 | RecordMissingRequiredField
621 | StaticCallWithClassLevelReifiedGeneric
625 | InvalidReifiedFunctionPointer
626 | BadFunctionPointerConstruction
628 | TraitReuseInsideClass
630 | PocketUniversesInvalidUpperBounds
631 | PocketUniversesRefinement
632 | PocketUniversesReservedSyntax
634 | InvalidArrayKeyWrite
636 | NonObjectMemberWrite
(* EXTEND HERE WITH NEW VALUES IF NEEDED *)
637 [@@deriving enum
, show
{ with_path
= false }]
639 let err_code = to_enum
642 (* 5xxx: reserved for FB lint *)
643 (* 6xxx: reserved for FB ai *)
644 (* 7xxx: reserved for FB ai *)
648 | ForwardCompatibilityNotCurrent
[@value 8001]
649 | ForwardCompatibilityBelowMinimum
650 [@@deriving enum
, show
{ with_path
= false }]
652 let err_code = to_enum
655 (* 9xxx: reserved for FB ai *)
656 (* 10xxx: reserved for FB ai *)