Deprecate error 3007 (constructor-like method name)
[hiphop-php.git] / hphp / hack / src / errors / error_codes.ml
blobb3d87575b81a84891174fc0e8f337352157f3a55
1 (*
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
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 (*****************************************************************************)
16 (* Error codes.
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
26 * future. *)
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
37 end
39 module Parsing = struct
40 type t =
41 | FixmeFormat [@value 1001]
42 | ParsingError
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
51 end
53 module Naming = struct
54 type t =
55 | AddATypehint [@value 2001]
56 | TypeparamAlokDEPRECATED
57 | AssertArity
58 | PrimitiveInvalidAlias
59 | CyclicConstraintDEPRECATED
60 | DidYouMeanNaming
61 | DifferentScopeDEPRECATED
62 | DisallowedXhpType
63 | DoubleInsteadOfFloatDEPRECATED
64 | DynamicClassDEPRECATED
65 | LvarInObjGet
66 | ErrorNameAlreadyBound
67 | ExpectedCollection
68 | ExpectedVariable
69 | FdNameAlreadyBound
70 | GenArrayRecArityDEPRECATED
71 | GenArrayVaRecArityDEPRECATED
72 | GenaArityDEPRECATED
73 | GenericClassVarDEPRECATED
74 | GenvaArity
75 | IllegalClass
76 | IllegalClassMeth
77 | IllegalConstant
78 | IllegalFun
79 | IllegalInstMeth
80 | IllegalMethCaller
81 | IllegalMethFun
82 | IntegerInsteadOfIntDEPRECATED
83 | InvalidReqExtends
84 | InvalidReqImplements
85 | LocalConstDEPRECATED
86 | LowercaseThis
87 | MethodNameAlreadyBound
88 | MissingArrow
89 | MissingTypehint
90 | NameAlreadyBound
91 | NamingTooFewArguments
92 | NamingTooManyArguments
93 | PrimitiveToplevel
94 | RealInsteadOfFloatDEPRECATED
95 | ShadowedTypeParam
96 | StartWith_T
97 | ThisMustBeReturn
98 | ThisNoArgument
99 | ThisHintOutsideClass
100 | ThisReserved
101 | TparamWithTparam
102 | TypedefConstraintDEPRECATED
103 | UnboundName
104 | Undefined
105 | UnexpectedArrow
106 | UnexpectedTypedef
107 | UsingInternalClass
108 | VoidCast
109 | ObjectCast
110 | UnsetCast
111 | NullsafePropertyAccessDEPRECATED
112 | IllegalTrait
113 | ShapeTypehintDEPRECATED
114 | DynamicNewInStrictMode
115 | InvalidTypeAccessRoot
116 | DuplicateUserAttribute
117 | ReturnOnlyTypehint
118 | UnexpectedTypeArguments
119 | TooManyTypeArguments
120 | ClassnameParam
121 | InvalidInstanceofDEPRECATED
122 | NameIsReserved
123 | DollardollarUnused
124 | IllegalMemberVariableClass
125 | TooFewTypeArguments
126 | GotoLabelAlreadyDefined
127 | GotoLabelUndefined
128 | GotoLabelDefinedInFinally
129 | GotoInvokedInFinally
130 | DynamicClassPropertyNameInStrictModeDEPRECATED
131 | ThisAsLexicalVariable
132 | DynamicClassNameInStrictMode
133 | XhpOptionalRequiredAttr
134 | XhpRequiredWithDefault
135 | VariableVariablesDisallowedDEPRECATED
136 | ArrayTypehintsDisallowed
137 | ArrayLiteralsDisallowed
138 | WildcardDisallowed
139 | AttributeClassNameConflict
140 | MethodNeedsVisibility
141 | ReferenceInStrictMode
142 | ReferenceInRx
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
159 | InvalidFunPointer
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
171 type t =
172 | AbstractBody [@value 3001]
173 | AbstractWithBody
174 | AwaitInSyncFunction
175 | CallBeforeInit
176 | CaseFallthrough
177 | ContinueInSwitch
178 | DangerousMethodNameDEPRECATED
179 | DefaultFallthrough
180 | InterfaceWithMemberVariable
181 | InterfaceWithStaticMemberVariable
182 | Magic
183 | NoConstructParent
184 | NonInterface
185 | NotAbstractWithoutBody
186 | NotInitialized
187 | NotPublicInterface
188 | RequiresNonClass
189 | ReturnInFinally
190 | ReturnInGen
191 | ToStringReturnsString
192 | ToStringVisibility
193 | ToplevelBreak
194 | ToplevelContinue
195 | UsesNonTrait
196 | IllegalFunctionName
197 | NotAbstractWithoutTypeconst
198 | TypeconstDependsOnExternalTparam
199 | TypeconstAssignedTparamDEPRECATED
200 | AbstractWithTypeconstDEPRECATED
201 | ConstructorRequired
202 | InterfaceWithPartialTypeconst
203 | MultipleXhpCategory
204 | OptionalShapeFieldsNotSupportedDEPRECATED
205 | AwaitNotAllowedDEPRECATED
206 | AsyncInInterfaceDEPRECATED
207 | AwaitInCoroutine
208 | YieldInCoroutine
209 | SuspendOutsideOfCoroutine
210 | SuspendInFinally
211 | BreakContinueNNotSupported
212 | StaticMemoizedFunction
213 | InoutParamsOutsideOfSync
214 | InoutParamsSpecial
215 | InoutParamsMixByref
216 | InoutParamsMemoize
217 | InoutParamsRetByRefDEPRECATED
218 | ReadingFromAppend
219 | ConstAttributeProhibitedDEPRECATED
220 | RetiredError3049DEPRECATED
221 | InoutArgumentBadExpr
222 | MutableParamsOutsideOfSyncDEPRECATED
223 | MutableAsyncMethodDEPRECATED
224 | MutableMethodsMustBeReactive
225 | MutableAttributeOnFunction
226 | MutableReturnAnnotatedDeclsMustBeReactive
227 | IllegalDestructor
228 | ConditionallyReactiveFunctionDEPRECATED
229 | MultipleConditionallyReactiveAnnotations
230 | ConditionallyReactiveAnnotationInvalidArguments
231 | MissingReactivityForConditionDEPRECATED
232 | MultipleReactivityAnnotationsDEPRECATED
233 | RxIsEnabledInvalidLocation
234 | MaybeRxInvalidLocation
235 | NoOnlyrxIfRxfuncForRxIfArgs
236 | CoroutineInConstructor
237 | IllegalReturnByRefDEPRECATED
238 | IllegalByRefExpr
239 | VariadicByRefParam
240 | MaybeMutableAttributeOnFunction
241 | ConflictingMutableAndMaybeMutableAttributes
242 | MaybeMutableMethodsMustBeReactive
243 | RequiresFinalClass
244 | InterfaceUsesTrait
245 | NonstaticMethodInAbstractFinalClass
246 | MutableOnStaticDEPRECATED
247 | ClassnameConstInstanceOfDEPRECATED
248 | ByRefParamOnConstruct
249 | ByRefDynamicCall
250 | ByRefProperty
251 | ByRefCall
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
261 type t =
262 | AbstractClassFinalDEPRECATED [@value 4001]
263 | UninstantiableClass
264 | AnonymousRecursive
265 | AnonymousRecursiveCall
266 | ArrayAccess
267 | ArrayAppend
268 | ArrayCast
269 | ArrayGetArity
270 | BadCall
271 | ClassArityDEPRECATED
272 | ConstMutation
273 | ConstructorNoArgs
274 | CyclicClassDef
275 | CyclicTypedef
276 | DiscardedAwaitable
277 | IssetEmptyInStrict
278 | DynamicYieldPrivateDEPRECATED
279 | EnumConstantTypeBad
280 | EnumSwitchNonexhaustive
281 | EnumSwitchNotConst
282 | EnumSwitchRedundant
283 | EnumSwitchRedundantDefault
284 | EnumSwitchWrongClass
285 | EnumTypeBad
286 | EnumTypeTypedefMixedDEPRECATED
287 | ExpectedClass
288 | ExpectedLiteralFormatString
289 | ExpectedStaticIntDEPRECATED
290 | ExpectedTparam
291 | ExpectingReturnTypeHint
292 | ExpectingReturnTypeHintSuggestDEPRECATED
293 | ExpectingTypeHint
294 | ExpectingTypeHintVariadic
295 | RetiredError4034DEPRECATED
296 | ExtendFinal
297 | FieldKinds
298 | FieldMissingDEPRECATED
299 | FormatString
300 | FunArityMismatch
301 | FunTooFewArgs
302 | FunTooManyArgs
303 | FunUnexpectedNonvariadic
304 | FunVariadicityHhVsPhp56
305 | GenaExpectsArrayDEPRECATED
306 | GenericArrayStrict
307 | GenericStatic
308 | ImplementAbstract
309 | InterfaceFinalDEPRECATED
310 | InvalidShapeFieldConst
311 | InvalidShapeFieldLiteral
312 | InvalidShapeFieldName
313 | InvalidShapeFieldType
314 | MemberNotFound
315 | MemberNotImplemented
316 | MissingAssign
317 | MissingConstructor
318 | MissingField
319 | NegativeTupleIndexDEPRECATED
320 | SelfOutsideClass
321 | NewStaticInconsistent
322 | StaticOutsideClass
323 | NonObjectMember
324 | NullContainer
325 | NullMember
326 | NullableParameterDEPRECATED
327 | OptionReturnOnlyTypehint
328 | ObjectString
329 | OptionMixed
330 | OverflowDEPRECATED
331 | OverrideFinal
332 | OverridePerTrait
333 | PairArityDEPRECATED
334 | AbstractCall
335 | ParentInTrait
336 | ParentOutsideClass
337 | ParentUndefined
338 | PreviousDefault
339 | PrivateClassMeth
340 | PrivateInstMeth
341 | PrivateOverride
342 | ProtectedClassMeth
343 | ProtectedInstMeth
344 | ReadBeforeWrite
345 | ReturnInVoid
346 | ShapeFieldClassMismatch
347 | ShapeFieldTypeMismatch
348 | ShouldBeOverride
349 | SketchyNullCheckDEPRECATED
350 | SketchyNullCheckPrimitiveDEPRECATED
351 | SmemberNotFound
352 | StaticDynamic
353 | StaticOverflowDEPRECATED
354 | RetiredError4093DEPRECATED
355 | ThisInStaticDEPRECATED
356 | ThisVarOutsideClass
357 | TraitFinalDEPRECATED
358 | TupleArityDEPRECATED
359 | TupleArityMismatchDEPRECATED
360 | TupleIndexTooLargeDEPRECATED
361 | TupleSyntax
362 | TypeArityMismatch
363 | TypeParamArityDEPRECATED
364 | RetiredError4103DEPRECATED
365 | TypingTooFewArgs
366 | TypingTooManyArgs
367 | UnboundGlobal
368 | UnboundNameTyping
369 | UndefinedField
370 | UndefinedParent
371 | UnifyError
372 | UnsatisfiedReq
373 | Visibility
374 | VisibilityExtends
375 | VoidParameterDEPRECATED
376 | WrongExtendKind
377 | GenericUnify
378 | NullsafeNotNeeded
379 | TrivialStrictEq
380 | VoidUsage
381 | DeclaredCovariant
382 | DeclaredContravariant
383 | UnsetInStrictDEPRECATED
384 | StrictMembersNotKnown
385 | ErasedGenericAtRuntime
386 | DynamicClassDEPRECATED
387 | AttributeTooManyArguments
388 | AttributeParamType
389 | DeprecatedUse
390 | AbstractConstUsage
391 | CannotDeclareConstant
392 | CyclicTypeconst
393 | NullsafePropertyWriteContext
394 | NoreturnUsage
395 | ThisLvalueDEPRECATED
396 | UnsetNonidxInStrict
397 | InvalidShapeFieldNameEmpty
398 | InvalidShapeFieldNameNumberDEPRECATED
399 | ShapeFieldsUnknown
400 | InvalidShapeRemoveKey
401 | MissingOptionalFieldDEPRECATED
402 | ShapeFieldUnset
403 | AbstractConcreteOverride
404 | LocalVariableModifedAndUsed
405 | LocalVariableModifedTwice
406 | AssignDuringCase
407 | CyclicEnumConstraint
408 | UnpackingDisallowed
409 | InvalidClassname
410 | InvalidMemoizedParam
411 | IllegalTypeStructure
412 | NotNullableCompareNullTrivial
413 | ClassPropertyOnlyStaticLiteralDEPRECATED
414 | AttributeTooFewArguments
415 | ReferenceExprDEPRECATED
416 | UnificationCycle
417 | KeysetSet
418 | EqIncompatibleTypes
419 | ContravariantThis
420 | InstanceofAlwaysFalseDEPRECATED
421 | InstanceofAlwaysTrueDEPRECATED
422 | AmbiguousMember
423 | InstanceofGenericClassnameDEPRECATED
424 | RequiredFieldIsOptional
425 | FinalProperty
426 | ArrayGetWithOptionalField
427 | UnknownFieldDisallowedInShape
428 | NullableCast
429 | PassByRefAnnotationMissing
430 | NonCallArgumentInSuspend
431 | NonCoroutineCallInSuspend
432 | CoroutineCallOutsideOfSuspend
433 | FunctionIsNotCoroutine
434 | CoroutinnessMismatch
435 | ExpectingAwaitableReturnTypeHint
436 | ReffinessInvariant
437 | DollardollarLvalue
438 | StaticMethodOnInterfaceDEPRECATED
439 | DuplicateUsingVar
440 | IllegalDisposable
441 | EscapingDisposable
442 | PassByRefAnnotationUnexpected
443 | InoutAnnotationMissing
444 | InoutAnnotationUnexpected
445 | InoutnessMismatch
446 | StaticSyntheticMethod
447 | TraitReuse
448 | InvalidNewDisposable
449 | EscapingDisposableParameter
450 | AcceptDisposableInvariant
451 | InvalidDisposableHint
452 | XhpRequired
453 | EscapingThis
454 | IllegalXhpChild
455 | MustExtendDisposable
456 | InvalidIsAsExpressionHint
457 | AssigningToConst
458 | SelfConstParentNot
459 | ParentConstSelfNotDEPRECATED
460 | PartiallyValidIsAsExpressionHintDEPRECATED
461 | NonreactiveFunctionCall
462 | NonreactiveIndexing
463 | ObjSetReactive
464 | FunReactivityMismatch
465 | OverridingPropConstMismatch
466 | InvalidReturnDisposable
467 | InvalidDisposableReturnHint
468 | ReturnDisposableMismatch
469 | InoutArgumentBadType
470 | InconsistentUnsetDEPRECATED
471 | ReassignMutableVar
472 | InvalidFreezeTarget
473 | InvalidFreezeUse
474 | FreezeInNonreactiveContext
475 | MutableCallOnImmutable
476 | MutableArgumentMismatch
477 | InvalidMutableReturnResult
478 | MutableReturnResultMismatch
479 | NonreactiveCallFromShallow
480 | EnumTypeTypedefNonnull
481 | RxEnabledInNonRxContext
482 | RxEnabledInLambdasDEPRECATED
483 | AmbiguousLambda
484 | EllipsisStrictMode
485 | UntypedLambdaStrictMode
486 | BindingRefInArray
487 | EchoInReactiveContext
488 | SuperglobalInReactiveContext
489 | StaticPropertyInReactiveContext
490 | StaticInReactiveContextDEPRECATED
491 | GlobalInReactiveContextDEPRECATED
492 | WrongExpressionKindAttribute
493 | AttributeClassNoConstructorArgsDEPRECATED
494 | InvalidTypeForOnlyrxIfRxfuncParameter
495 | MissingAnnotationForOnlyrxIfRxfuncParameter
496 | CannotReturnBorrowedValueAsImmutable
497 | DeclOverrideMissingHint
498 | InvalidConditionallyReactiveCall
499 | ExtendSealed
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
513 | NonClassMember
514 | PassingArrayCellByRef
515 | CallSiteReactivityMismatch
516 | RxParameterConditionMismatch
517 | AmbiguousObjectAccess
518 | ExtendPPL
519 | ReassignMaybeMutableVar
520 | MaybeMutableArgumentMismatch
521 | ImmutableArgumentMismatch
522 | ImmutableCallOnMutable
523 | InvalidCallMaybeMutable
524 | MutabilityMismatch
525 | InvalidPPLCall
526 | InvalidPPLStaticCall
527 | TypeTestInLambdaDEPRECATED
528 | InvalidTraversableInRx
529 | ReassignMutableThis
530 | MutableExpressionAsMultipleMutableArguments
531 | InvalidUnsetTargetInRx
532 | CoroutineOutsideExperimental
533 | PPLMethPointer
534 | InvalidTruthinessTestDEPRECATED
535 | RePrefixedNonString
536 | BadRegexPattern
537 | SketchyTruthinessTestDEPRECATED
538 | LateInitWithDefault
539 | OverrideMemoizeLSB
540 | ClassVarTypeGenericParam
541 | InvalidSwitchCaseValueType
542 | StringCast
543 | BadLateInitOverride
544 | EscapingMutableObject
545 | OverrideLSB
546 | MultipleConcreteDefs
547 | MoveInNonreactiveContext
548 | InvalidMoveUse
549 | InvalidMoveTarget
550 | IgnoredResultOfFreezeDEPRECATED
551 | IgnoredResultOfMoveDEPRECATED
552 | UnexpectedTy
553 | UnserializableType
554 | InconsistentMutability
555 | InvalidMutabilityFlavorInAssignment
556 | OptionNull
557 | UnknownObjectMember
558 | UnknownType
559 | InvalidArrayKey
560 | ReferenceExprNotFunctionArg
561 | RedundantRxCondition
562 | RedeclaringMissingMethod
563 | InvalidEnforceableTypeArgument
564 | RequireArgsReify
565 | TypecheckerTimeout
566 | InvalidReifiedArgument
567 | GenericsNotAllowed
568 | InvalidNewableTypeArgument
569 | InvalidNewableTypeParamConstraints
570 | NewWithoutNewable
571 | NewStaticClassReified
572 | MemoizeReified
573 | ConsistentConstructReified
574 | MethodVariance
575 | MissingXhpRequiredAttr
576 | BadXhpAttrRequiredOverride
577 | ReifiedTparamVariadicDEPRECATED
578 | UnresolvedTypeVariable
579 | InvalidSubString
580 | InvalidArrayKeyConstraint
581 | OverrideNoDefaultTypeconst
582 | ShapeAccessWithNonExistentField
583 | DisallowPHPArraysAttr
584 | TypeConstraintViolation
585 | IndexTypeMismatch
586 | ExpectedStringlike
587 | TypeConstantMismatch
588 | TypeConstantRedeclarationDEPRECATED
589 | ConstantDoesNotMatchEnumType
590 | EnumConstraintMustBeArraykey
591 | EnumSubtypeMustHaveCompatibleConstraint
592 | ParameterDefaultValueWrongType
593 | NewtypeAliasMustSatisfyConstraint
594 | BadFunctionTypevar
595 | BadClassTypevar
596 | BadMethodTypevar
597 | MissingReturnInNonVoidFunction
598 | InoutReturnTypeMismatch
599 | ClassConstantValueDoesNotMatchHint
600 | ClassPropertyInitializerTypeDoesNotMatchHint
601 | BadDeclOverride
602 | BadMethodOverride
603 | BadEnumExtends
604 | XhpAttributeValueDoesNotMatchHint
605 | TraitPropConstClass
606 | EnumUnderlyingTypeMustBeArraykey
607 | ClassGetReified
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 *)
623 module Init = struct
624 type t =
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 *)