Skip to content
This repository was archived by the owner on Jun 1, 2024. It is now read-only.

Add aliasses for noreturn functions with nothing #109

Merged
merged 4 commits into from
Jun 6, 2022

Conversation

lexidor
Copy link
Contributor

@lexidor lexidor commented Mar 26, 2022

The noreturn variants affect the typechecker in interesting ways.
This is often sur# and breaks tests using expect($it)->toThrow().
I have seen the following workarounds in the wild.

if ('always true') {
  self::markTestSkipped('skipping');
}

(): void ==> {
  self::markTestSkipped('skipping');
}();

lexidor added 2 commits March 26, 2022 18:50
The noreturn variants affect the typechecker in interesting ways.
This is often sur# and breaks tests using expect($it)->toThrow().
I have seen the following workarounds in the wild.
```
if ('always true') {
  self::markTestSkipped('skipping');
}

(): void ==> {
  self::markTestSkipped('skipping');
}();
```
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 26, 2022
lexidor added 2 commits March 26, 2022 18:54
The word choice "bogus" was quite poor.
Typechecking in unreachable code may have false positives.
Baseless is more formal and bogus sounds a bit like an insult.
@Atry Atry merged commit de41cc9 into hhvm:main Jun 6, 2022
@Atry
Copy link
Contributor

Atry commented Jun 6, 2022

LGTM

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants