You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convert needs concrete override check to warning (was an error)
Summary:
For ease of adoption, we're starting with using warnings instead of errors for `__NeedsConcrete` checking.
This change is particularly important because without it it's hard to migrate the code base gradually, as we'd have to do whole hierarchies in one go.
## Examples
Here are what the warnings look like with pretty-printing and context. These examples are also used in the test suite.
{F1982437894}
We take care to include the method name for methods defined in traits:
{F1982437893}
context in fb-only link below
Reviewed By: geralt-encore
Differential Revision: D83658029
fbshipit-source-id: 2a824c63649433da866be5debbf80922fe517047
^" is declared as `__NeedsConcrete` but overrides a non-`__NeedsConcrete` method. Please add `__NeedsConcrete` to the overridden method or remove it from the current method. (The `__NeedsConcrete` attribute indicates that a method requires `static` to point to a concrete class)"
732
+
733
+
letreasons
734
+
{
735
+
Typing_warning.Needs_concrete_override.pos;
736
+
parent_pos;
737
+
method_name_for_method_defined_outside_class = _;
738
+
}=
739
+
[
740
+
( pos,
741
+
"It is unsafe to declare this method as `__NeedsConcrete`, since it overrides a non-`__NeedsConcrete` method"
742
+
);
743
+
(parent_pos, "Previously defined here");
744
+
]
745
+
746
+
letquickfixes_=[]
747
+
end
748
+
710
749
letmodule_of (typeax) (kind: (x, a) Typing_warning.kind) :
711
750
(module Warning withtypet = x) =
712
751
match kind with
@@ -730,6 +769,7 @@ let module_of (type a x) (kind : (x, a) Typing_warning.kind) :
WARN: File "needs_concrete_override_1.php", line 9, characters 19-21:
2
+
This method is declared as `__NeedsConcrete` but overrides a non-`__NeedsConcrete` method. Please add `__NeedsConcrete` to the overridden method or remove it from the current method. (The `__NeedsConcrete` attribute indicates that a method requires `static` to point to a concrete class) (Warn[12027])
3
+
File "needs_concrete_override_1.php", line 9, characters 19-21:
4
+
It is unsafe to declare this method as `__NeedsConcrete`, since it overrides a non-`__NeedsConcrete` method
5
+
File "needs_concrete_override_1.php", line 4, characters 19-21:
0 commit comments