facebookarchive / hack-langspec

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

Mistakes and omissions regarding awaitables #101

Open ericlippert opened 7 years ago

ericlippert commented 7 years ago

Chapter 10 says

If async is present, return-type must be a type that implements Awaitable.

That is incorrect; the type must be exactly Awaitable or Awaitable for some T. An interface which extends Awaitable or a class which implements Awaitable is not legal here.

Chapter 16 does not mention at all that an async method must have a particular return type. (Though this is subtly implied by the note which says that an abstract non-async method may be awaitable.)