hhvm / hhast

Mutable AST library for Hack with linting and code migrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drop support for the `@` error suppression operator

lexidor opened this issue · comments

@ has been reserved for new attribute syntax.

<<__Memoize>>
function life(): int { return 42; }
// Becomes
@__Memoize
function life(): int { return 42; }

The typechecker option disallow_silence can be enabled to ban @ error suppression.
The typechecker option allow_new_attribute_syntax can be enabled to allow @Attribute support.
The runtime option hhvm.hack.lang.allow_new_attribute_syntax can be enabled to enable @Attribute support at runtime.

Hack OSS libs have typechecked with disallow_silence enabled since November of 2019. It has not been mentioned on the blog yet, so private codebases may very well still contain a lot of @fopen(__FILE__) code.