Skip to main content
This annotation is intended for complex cases and is primarily designed to be used by the built-in annotations.

Overview

A type check such as isentity(x) returns true for an Entity and for every class built on it, such as Player and Weapon. So when it returns false, the value is none of them. exhaustive_type_guard tells GLuaLS this. In the false branch, the checked class and all its subclasses are removed from the value’s type. Without it, only the exact class is removed.

Syntax

Put it after the @return line. The function must return TypeGuard<T>.

Example


See also

  • @valid_guard: a function that proves its argument is valid