lib/rbs/definition_builder.rb in rbs-3.4.4 vs lib/rbs/definition_builder.rb in rbs-3.5.0.pre.1
- old
+ new
@@ -628,16 +628,16 @@
implemented_in: implemented_in
)
end
# @type var accessibility: RBS::Definition::accessibility
- accessibility = if method.name == :initialize
- :private
- else
- method.accessibility
- end
-
+ accessibility =
+ if original.instance? && [:initialize, :initialize_copy, :initialize_clone, :initialize_dup, :respond_to_missing?].include?(method.name)
+ :private
+ else
+ method.accessibility
+ end
# Skip setting up `super_method` if `implemented_in` is `nil`, that means the type doesn't have implementation.
# This typically happens if the type is an interface.
if implemented_in
super_method = existing_method
end
@@ -667,18 +667,18 @@
required_positionals: [
Types::Function::Param.new(type: attr_type, name: original.name)
]
),
block: nil,
- location: nil
+ location: original.location
)
else
# getter
MethodType.new(
type_params: [],
type: Types::Function.empty(attr_type),
block: nil,
- location: nil
+ location: original.location
)
end
if implemented_in
super_method = existing_method