Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions core/rbs/ops.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
module RBS
module Ops
# An interface for types implementing the `+` operator
interface _Add[O, R = self]

Check failure on line 4 in core/rbs/ops.rbs

View workflow job for this annotation

GitHub Actions / test (4.0, rubocop validate test_doc build test_generate_stdlib raap)

RBS/Lint/Syntax: self type is not allowed here, token=`self` (kSELF)
# Perform the `+` operation
def +: (O other) -> R
end

# An interface for types implementing the `-` operator
interface _Subtract[O, R = self]
# Perform the `-` operation
def -: (O other) -> R
end

# An interface for types implementing the `*` operator
interface _Times[O, R = self]
# Perform the `*` operation
def *: (O other) -> R
end

# An interface for types implementing the `/` operator
interface _Divide[O, R = self]
# Perform the `/` operation
def /: (O other) -> R
end

# An interface for types implementing the `%` operator
interface _Modulo[O, R = self]
# Perform the `%` operation
def %: (O other) -> R
end

# An interface for types implementing the `**` operator
interface _Power[O, R = self]
# Perform the `**` operation
def **: (O other) -> R
end

# An interface for types implementing the `<` operator
interface _LessThan[O, R = bool]
# Perform the `<` operation
def <: (O other) -> R
end

# An interface for types implementing the `>` operator
interface _GreaterThan[O, R = bool]
# Perform the `>` operation
def >: (O other) -> R
end

# An interface for types implementing the `<=` operator
interface _LessThanOrEqual[O, R = bool]
# Perform the `<=` operation
def <=: (O other) -> R
end

# An interface for types implementing the `>=` operator
interface _GreaterThanOrEqual[O, R = bool]
# Perform the `>=` operation
def >=: (O other) -> R
end

# An interface for types implementing the `<=>` operator
interface _Compare[O = untyped, R = (-1 | 0 | 1)?]
# Perform the `<=>` operation
def <=>: (O other) -> R
end

# An interface for types implementing the `&` operator
interface _And[O, R = self]
# Perform the `&` operation
def &: (O other) -> R
end

# An interface for types implementing the `|` operator
interface _Or[O, R = self]
# Perform the `|` operation
def |: (O other) -> R
end

# An interface for types implementing the `^` operator
interface _Xor[O, R = self]
# Perform the `^` operation
def ^: (O other) -> R
end

# An interface for types implementing the `<<` operator
interface _LeftShift[O, R = self]
# Perform the `<<` operation
def <<: (O other) -> R
end

# An interface for types implementing the `>>` operator
interface _RightShift[O, R = self]
# Perform the `>>` operation
def >>: (O other) -> R
end

# An interface for types implementing the `~` operator
interface _Not[R = self]
# Perform the `~` operation
def ~: () -> R
end

# An interface for types implementing the `+@` operator
interface _UnaryPos[R = self]
# Perform the `+@` operation
def +@: () -> R
end

# An interface for types implementing the `-@` operator
interface _UnaryNeg[R = self]
# Perform the `-@` operation
def -@: () -> R
end

# An interface for types implementing the `!` operator
interface _LogicalNot[R = bool]
# Perform the `!` operation
def !: () -> R
end

# An interface for types implementing the `==` operator
interface _Equal[O = untyped, R = bool]
# Perform the `==` operation
def ==: (O other) -> R
end

# An interface for types implementing the `===` operator
interface _CaseEqual[O, R = bool]
# Perform the `===` operation
def ===: (O other) -> R
end

# An interface for types implementing the `=~` operator
interface _Matches[O, R]
# Perform the `=~` operation
def =~: (O other) -> R
end

# An interface for types implementing the `!=` operator
interface _NotEqual[O = untyped, R = bool]
# Perform the `!=` operation
def !=: (O other) -> R
end

# An interface for types implementing the `!~` operator
interface _NotMatches[O, R = bool]
# Perform the `!~` operation
def !~: (O other) -> R
end
end
end

Loading