-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementations of abstract methods can have supertype parameter types
Summary: Currently the case if `force_hh` is on. Make it true for any subclasses in Hack, rather than PHP. Going to put up a separate diff RE this only applying to abstract functions. refs #8256 Reviewed By: swtaarrs Differential Revision: D8868379 fbshipit-source-id: 83f749139c610e6b0546695b6090f0970bf302b5
- Loading branch information
1 parent
0bcc1e9
commit 9e99004
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?hh // strict | ||
|
||
class ParamBase { | ||
} | ||
|
||
class ParamSub extends ParamBase { | ||
} | ||
|
||
abstract class ImplBase { | ||
abstract public function doStuff(ParamSub $_): void; | ||
} | ||
|
||
class ImplSub extends ImplBase { | ||
public function doStuff(ParamBase $_): void { | ||
} | ||
} | ||
|
||
function main(): void { | ||
(new ImplSub())->doStuff(new ParamSub()); | ||
} | ||
|
||
main(); |
Empty file.