facebookarchive / hack-langspec

The official Hack Language specification.
http://hacklang.org
Other
172 stars 48 forks source link

Restrictions on interface methods should be clarified #94

Open ericlippert opened 7 years ago

ericlippert commented 7 years ago

The text of chapter 17 on interface methods says

"Methods declared in an interface must not be declared abstract."

That's correct but incomplete. We should add to this:

This is good to point out because many languages do not allow static interface methods.

Clearly it makes no sense to have a protected or private interface member; they're implicitly public.

HHVM allows the "public" to be elided, even though technically that is not quite grammatical. I think that's a reasonable rule.