Skip to content

Commit

Permalink
core: Add _Top interface to support inverting boolish
Browse files Browse the repository at this point in the history
To support inverting boolish values, adds a new interface `_Top` that
provides `!` operator.

refs: soutaro/steep#939
  • Loading branch information
tk0miya committed Oct 24, 2023
1 parent 2cac4e7 commit ab9980d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/builtin.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,9 @@ type interned = Symbol | string
# Any Ruby object can have `boolish` type.
#
type boolish = top

# `_Top` is an internal type for the `top` type.
# It provides `!` operator to support inverting `top` and `boolish` objects.
interface _Top
def !: () -> bool
end

0 comments on commit ab9980d

Please sign in to comment.