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 (* 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
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 | ReferenceInStrictMode
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 (* EXTEND HERE WITH NEW VALUES IF NEEDED *)
165 [@@deriving enum
, show
{ with_path
= false }]
167 let err_code = to_enum
170 module NastCheck
= struct
172 | AbstractBody
[@value 3001]
174 | AwaitInSyncFunction
178 | DangerousMethodNameDEPRECATED
180 | InterfaceWithMemberVariable
181 | InterfaceWithStaticMemberVariable
185 | NotAbstractWithoutBody
191 | ToStringReturnsString
196 | IllegalFunctionName
197 | NotAbstractWithoutTypeconst
198 | TypeconstDependsOnExternalTparam
199 | TypeconstAssignedTparamDEPRECATED
200 | AbstractWithTypeconstDEPRECATED
201 | ConstructorRequired
202 | InterfaceWithPartialTypeconst
203 | MultipleXhpCategory
204 | OptionalShapeFieldsNotSupportedDEPRECATED
205 | AwaitNotAllowedDEPRECATED
206 | AsyncInInterfaceDEPRECATED
209 | SuspendOutsideOfCoroutine
211 | BreakContinueNNotSupported
212 | StaticMemoizedFunction
213 | InoutParamsOutsideOfSync
215 | InoutParamsMixByref
217 | InoutParamsRetByRefDEPRECATED
219 | ConstAttributeProhibitedDEPRECATED
220 | RetiredError3049DEPRECATED
221 | InoutArgumentBadExpr
222 | MutableParamsOutsideOfSyncDEPRECATED
223 | MutableAsyncMethodDEPRECATED
224 | MutableMethodsMustBeReactive
225 | MutableAttributeOnFunction
226 | MutableReturnAnnotatedDeclsMustBeReactive
228 | ConditionallyReactiveFunctionDEPRECATED
229 | MultipleConditionallyReactiveAnnotations
230 | ConditionallyReactiveAnnotationInvalidArguments
231 | MissingReactivityForConditionDEPRECATED
232 | MultipleReactivityAnnotationsDEPRECATED
233 | RxIsEnabledInvalidLocation
234 | MaybeRxInvalidLocation
235 | NoOnlyrxIfRxfuncForRxIfArgs
236 | CoroutineInConstructor
237 | IllegalReturnByRefDEPRECATED
240 | MaybeMutableAttributeOnFunction
241 | ConflictingMutableAndMaybeMutableAttributes
242 | MaybeMutableMethodsMustBeReactive
245 | NonstaticMethodInAbstractFinalClass
246 | MutableOnStaticDEPRECATED
247 | ClassnameConstInstanceOfDEPRECATED
248 | ByRefParamOnConstruct
252 | SwitchNonTerminalDefault
253 | SwitchMultipleDefault
254 (* EXTEND HERE WITH NEW VALUES IF NEEDED *)
255 [@@deriving enum
, show
{ with_path
= false }]
257 let err_code = to_enum
260 module Typing
= struct
262 | AbstractClassFinalDEPRECATED
[@value 4001]
263 | UninstantiableClass
265 | AnonymousRecursiveCall
271 | ClassArityDEPRECATED
278 | DynamicYieldPrivateDEPRECATED
279 | EnumConstantTypeBad
280 | EnumSwitchNonexhaustive
282 | EnumSwitchRedundant
283 | EnumSwitchRedundantDefault
284 | EnumSwitchWrongClass
286 | EnumTypeTypedefMixedDEPRECATED
288 | ExpectedLiteralFormatString
289 | ExpectedStaticIntDEPRECATED
291 | ExpectingReturnTypeHint
292 | ExpectingReturnTypeHintSuggestDEPRECATED
294 | ExpectingTypeHintVariadic
295 | RetiredError4034DEPRECATED
298 | FieldMissingDEPRECATED
303 | FunUnexpectedNonvariadic
304 | FunVariadicityHhVsPhp56
305 | GenaExpectsArrayDEPRECATED
309 | InterfaceFinalDEPRECATED
310 | InvalidShapeFieldConst
311 | InvalidShapeFieldLiteral
312 | InvalidShapeFieldName
313 | InvalidShapeFieldType
315 | MemberNotImplemented
319 | NegativeTupleIndexDEPRECATED
321 | NewStaticInconsistent
326 | NullableParameterDEPRECATED
327 | OptionReturnOnlyTypehint
333 | PairArityDEPRECATED
346 | ShapeFieldClassMismatch
347 | ShapeFieldTypeMismatch
349 | SketchyNullCheckDEPRECATED
350 | SketchyNullCheckPrimitiveDEPRECATED
353 | StaticOverflowDEPRECATED
354 | RetiredError4093DEPRECATED
355 | ThisInStaticDEPRECATED
356 | ThisVarOutsideClass
357 | TraitFinalDEPRECATED
358 | TupleArityDEPRECATED
359 | TupleArityMismatchDEPRECATED
360 | TupleIndexTooLargeDEPRECATED
363 | TypeParamArityDEPRECATED
364 | RetiredError4103DEPRECATED
375 | VoidParameterDEPRECATED
382 | DeclaredContravariant
383 | UnsetInStrictDEPRECATED
384 | StrictMembersNotKnown
385 | ErasedGenericAtRuntime
386 | DynamicClassDEPRECATED
387 | AttributeTooManyArguments
391 | CannotDeclareConstant
393 | NullsafePropertyWriteContext
395 | ThisLvalueDEPRECATED
396 | UnsetNonidxInStrict
397 | InvalidShapeFieldNameEmpty
398 | InvalidShapeFieldNameNumberDEPRECATED
400 | InvalidShapeRemoveKey
401 | MissingOptionalFieldDEPRECATED
403 | AbstractConcreteOverride
404 | LocalVariableModifedAndUsed
405 | LocalVariableModifedTwice
407 | CyclicEnumConstraint
408 | UnpackingDisallowed
410 | InvalidMemoizedParam
411 | IllegalTypeStructure
412 | NotNullableCompareNullTrivial
413 | ClassPropertyOnlyStaticLiteralDEPRECATED
414 | AttributeTooFewArguments
415 | ReferenceExprDEPRECATED
418 | EqIncompatibleTypes
420 | InstanceofAlwaysFalseDEPRECATED
421 | InstanceofAlwaysTrueDEPRECATED
423 | InstanceofGenericClassnameDEPRECATED
424 | RequiredFieldIsOptional
426 | ArrayGetWithOptionalField
427 | UnknownFieldDisallowedInShape
429 | PassByRefAnnotationMissing
430 | NonCallArgumentInSuspend
431 | NonCoroutineCallInSuspend
432 | CoroutineCallOutsideOfSuspend
433 | FunctionIsNotCoroutine
434 | CoroutinnessMismatch
435 | ExpectingAwaitableReturnTypeHint
438 | StaticMethodOnInterfaceDEPRECATED
442 | PassByRefAnnotationUnexpected
443 | InoutAnnotationMissing
444 | InoutAnnotationUnexpected
446 | StaticSyntheticMethod
448 | InvalidNewDisposable
449 | EscapingDisposableParameter
450 | AcceptDisposableInvariant
451 | InvalidDisposableHint
455 | MustExtendDisposable
456 | InvalidIsAsExpressionHint
459 | ParentConstSelfNotDEPRECATED
460 | PartiallyValidIsAsExpressionHintDEPRECATED
461 | NonreactiveFunctionCall
462 | NonreactiveIndexing
464 | FunReactivityMismatch
465 | OverridingPropConstMismatch
466 | InvalidReturnDisposable
467 | InvalidDisposableReturnHint
468 | ReturnDisposableMismatch
469 | InoutArgumentBadType
470 | InconsistentUnsetDEPRECATED
472 | InvalidFreezeTarget
474 | FreezeInNonreactiveContext
475 | MutableCallOnImmutable
476 | MutableArgumentMismatch
477 | InvalidMutableReturnResult
478 | MutableReturnResultMismatch
479 | NonreactiveCallFromShallow
480 | EnumTypeTypedefNonnull
481 | RxEnabledInNonRxContext
482 | RxEnabledInLambdasDEPRECATED
485 | UntypedLambdaStrictMode
487 | EchoInReactiveContext
488 | SuperglobalInReactiveContext
489 | StaticPropertyInReactiveContext
490 | StaticInReactiveContextDEPRECATED
491 | GlobalInReactiveContextDEPRECATED
492 | WrongExpressionKindAttribute
493 | AttributeClassNoConstructorArgsDEPRECATED
494 | InvalidTypeForOnlyrxIfRxfuncParameter
495 | MissingAnnotationForOnlyrxIfRxfuncParameter
496 | CannotReturnBorrowedValueAsImmutable
497 | DeclOverrideMissingHint
498 | InvalidConditionallyReactiveCall
500 | SealedFinalDEPRECATED
501 | ComparisonInvalidTypes
502 | OptionVoidDEPRECATED
503 | MutableInNonreactiveContext
504 | InvalidArgumentOfRxMutableFunction
505 | LetVarImmutabilityViolation
506 | UnsealableDEPRECATED
507 | ReturnVoidToRxMismatch
508 | ReturnsVoidToRxAsNonExpressionStatement
509 | NonawaitedAwaitableInReactiveContext
510 | ShapesKeyExistsAlwaysTrue
511 | ShapesKeyExistsAlwaysFalse
512 | ShapesMethodAccessWithNonExistentField
514 | PassingArrayCellByRef
515 | CallSiteReactivityMismatch
516 | RxParameterConditionMismatch
517 | AmbiguousObjectAccess
519 | ReassignMaybeMutableVar
520 | MaybeMutableArgumentMismatch
521 | ImmutableArgumentMismatch
522 | ImmutableCallOnMutable
523 | InvalidCallMaybeMutable
526 | InvalidPPLStaticCall
527 | TypeTestInLambdaDEPRECATED
528 | InvalidTraversableInRx
529 | ReassignMutableThis
530 | MutableExpressionAsMultipleMutableArguments
531 | InvalidUnsetTargetInRx
532 | CoroutineOutsideExperimental
534 | InvalidTruthinessTestDEPRECATED
535 | RePrefixedNonString
537 | SketchyTruthinessTestDEPRECATED
538 | LateInitWithDefault
540 | ClassVarTypeGenericParam
541 | InvalidSwitchCaseValueType
543 | BadLateInitOverride
544 | EscapingMutableObject
546 | MultipleConcreteDefs
547 | MoveInNonreactiveContext
550 | IgnoredResultOfFreezeDEPRECATED
551 | IgnoredResultOfMoveDEPRECATED
554 | InconsistentMutability
555 | InvalidMutabilityFlavorInAssignment
557 | UnknownObjectMember
560 | ReferenceExprNotFunctionArg
561 | RedundantRxCondition
562 | RedeclaringMissingMethod
563 | InvalidEnforceableTypeArgument
566 | InvalidReifiedArgument
568 | InvalidNewableTypeArgument
569 | InvalidNewableTypeParamConstraints
571 | NewStaticClassReified
573 | ConsistentConstructReified
575 | MissingXhpRequiredAttr
576 | BadXhpAttrRequiredOverride
577 | ReifiedTparamVariadicDEPRECATED
578 | UnresolvedTypeVariable
580 | InvalidArrayKeyConstraint
581 | OverrideNoDefaultTypeconst
582 | ShapeAccessWithNonExistentField
583 | DisallowPHPArraysAttr
584 | TypeConstraintViolation
587 | TypeConstantMismatch
588 | TypeConstantRedeclarationDEPRECATED
589 | ConstantDoesNotMatchEnumType
590 | EnumConstraintMustBeArraykey
591 | EnumSubtypeMustHaveCompatibleConstraint
592 | ParameterDefaultValueWrongType
593 | NewtypeAliasMustSatisfyConstraint
597 | MissingReturnInNonVoidFunction
598 | InoutReturnTypeMismatch
599 | ClassConstantValueDoesNotMatchHint
600 | ClassPropertyInitializerTypeDoesNotMatchHint
604 | XhpAttributeValueDoesNotMatchHint
605 | TraitPropConstClass
606 | EnumUnderlyingTypeMustBeArraykey
608 | RequireGenericExplicit
609 | ClassConstantTypeMismatch
610 | PocketUniversesExpansion
611 | PocketUniversesTyping
612 | RecordInitValueDoesNotMatchHint
613 (* EXTEND HERE WITH NEW VALUES IF NEEDED *)
614 [@@deriving enum
, show
{ with_path
= false }]
616 let err_code = to_enum
619 (* 5xxx: reserved for FB lint *)
620 (* 6xxx: reserved for FB ai *)
621 (* 7xxx: reserved for FB ai *)
625 | ForwardCompatibilityNotCurrent
[@value 8001]
626 | ForwardCompatibilityBelowMinimum
627 [@@deriving enum
, show
{ with_path
= false }]
629 let err_code = to_enum
632 (* 9xxx: reserved for FB ai *)
633 (* 10xxx: reserved for FB ai *)