Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New hack mode: require typehints for definitions in that file, but allow calling non-Hack code #3273

Closed
fredemmott opened this issue Jul 24, 2014 · 4 comments

Comments

@fredemmott
Copy link
Contributor

Request from Davey on freenode.

Behavior should be:

  • Every definition in that file requires a type hint; same as strict, unlike partial or decl
  • Still allow calling untyped functions; like partial or decl, unlike strict
@jwatzman
Copy link
Contributor

I can definitely see use cases for this; any objections I have are basically "we already have too many modes". @elgenie, @pikatchu, @gabelevi, any thoughts?

@dshafik
Copy link

dshafik commented Jul 24, 2014

I see this goal as a migratory mode: an indicator (and the type checker will complain if it's not) that the current file is ready to go strict, however it still calls into untyped functions as you haven't gotten around to updating them yet.

@lexidor lexidor mentioned this issue Sep 21, 2019
@lexidor
Copy link
Collaborator

lexidor commented May 14, 2020

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

This matches the current behavior of // strict mode. I wasn't involved with hhvm in 2014, when this issue was made, and I have two conflicting ideas about what the issue author could have meant.
Either untyped means, a Hack function in a partial or decl file, with missing parameter / return types or it means an undeclared / php function.

PHP functions can not be called in hhvm anymore, since PHP support was dropped with the release of hhvm 4.0.0.
Strict code can call // partial and // decl code since at least hhvm 3.24.

@lexidor lexidor closed this as completed May 14, 2020
@jwatzman
Copy link
Contributor

Yeah I suspect "calling untyped functions" likely referred to the ancient assume_php, which used to be available in partial/decl but not strict. AFAIK it's entirely gone now and has been for a very long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants