Skip to content

Commit 9568cb1

Browse files
authored
Merge pull request #2328 from ruby/update-steep
Update steep
2 parents 811821f + 7a0cd3f commit 9568cb1

File tree

18 files changed

+41
-43
lines changed

18 files changed

+41
-43
lines changed

core/kernel.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ module Kernel : BasicObject
17291729
def self?.sleep: (?nil) -> bot
17301730
| (Time::_Timeout duration) -> Integer
17311731

1732-
%a{steep:deprecated}
1732+
%a{deprecated}
17331733
interface _Divmod
17341734
def divmod: (Numeric) -> [ Numeric, Numeric ]
17351735
end

core/module.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,6 +1699,6 @@ class Module < Object
16991699
def attr: (*interned arg0) -> Array[Symbol]
17001700

17011701
# A previous incarnation of `interned` for backward-compatibility (see #1499)
1702-
%a{steep:deprecated}
1702+
%a{deprecated: Use `interned`}
17031703
type id = interned
17041704
end

core/object.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@ class Object < BasicObject
106106
end
107107

108108
# A previous incarnation of `interned` for backward-compatibility (see #1499)
109-
%a{steep:deprecated}
109+
%a{deprecated: Use `interned` instead}
110110
type Object::name = interned

core/string.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,10 +3574,10 @@ class String
35743574
def valid_encoding?: () -> bool
35753575
end
35763576

3577-
%a{steep:deprecated}
3577+
%a{deprecated}
35783578
interface _ArefFromStringToString
35793579
def []: (String) -> String
35803580
end
35813581

3582-
%a{steep:deprecated}
3582+
%a{deprecated}
35833583
type String::encode_fallback = Hash[String, String] | Proc | Method | _ArefFromStringToString

lib/rbs/ast/type_param.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ def to_json(state = JSON::State.new)
5656
}.to_json(state)
5757
end
5858

59-
def rename(name)
60-
TypeParam.new(
61-
name: name,
62-
variance: variance,
63-
upper_bound: upper_bound_type,
64-
location: location,
65-
default_type: default_type
66-
).unchecked!(unchecked?)
67-
end
68-
6959
def map_type(&block)
7060
if b = upper_bound_type
7161
_upper_bound_type = yield(b)

lib/rbs/prototype/rb.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ def process(node, decls:, comments:, context:)
382382
name: const_name,
383383
type: type,
384384
location: nil,
385-
comment: comments[node.first_lineno - 1]
385+
comment: comments[node.first_lineno - 1],
386+
annotations: []
386387
)
387388

388389
when :IASGN

lib/rbs/prototype/rbi.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ def process(node, outer: [], comments:)
257257
name: name,
258258
type: type,
259259
location: nil,
260-
comment: nil
260+
comment: nil,
261+
annotations: []
261262
)
262263
end
263264
when :ALIAS

lib/rbs/prototype/runtime.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ def merge_rbs(module_name, members, instance: nil, singleton: nil)
250250
method = builder.build_singleton(module_name.absolute!).methods[singleton]
251251
method_name = singleton
252252
kind = :singleton
253+
else
254+
raise
253255
end
254256

255257
if method
@@ -462,6 +464,7 @@ def generate_constants(mod, decls)
462464
name: to_type_name(name.to_s),
463465
type: type,
464466
location: nil,
467+
annotations: [],
465468
comment: nil
466469
)
467470
end

lib/rbs/types.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,14 @@ class Void < Base; end
109109
class Any < Base
110110
def initialize(location:, todo: false)
111111
super(location: location)
112-
todo! if todo
112+
if todo
113+
@string = "__todo__"
114+
end
113115
end
114116

115117
def to_s(level=0)
116118
@string || "untyped"
117119
end
118-
119-
# @deprecated: this method is now called from the constructor, do not call it from outside
120-
def todo!
121-
@string = '__todo__'
122-
self
123-
end
124120
end
125121
class Nil < Base; end
126122
class Top < Base; end

lib/rbs/unit_test/with_aliases.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def with_range(start, stop, exclude_end = false)
127127

128128
# `Range` requires `begin <=> end` to return non-nil, but doesn't actually
129129
# end up using the return value of it. This is to add that in when needed.
130-
def lower.<=>(rhs) = :not_nil unless defined? lower.<=>
130+
unless defined? lower.<=>
131+
def lower.<=>(rhs) = :not_nil # steep:ignore MethodDefinitionInUndeclaredModule
132+
end
131133

132134
# If `lower <=> rhs` is defined but nil, then that means we're going to be constructing
133135
# an illegal range (eg `3..ToInt.new(4)`). So, we need to skip yielding an invalid range

0 commit comments

Comments
 (0)