Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions lib/rbs_rails/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,17 @@ def reload_#{a.name}: () -> #{type_optional}
args_node.children.each do |node|
case node.type
when :arg
res << "untyped #{node.children[0]}"
res << "untyped `#{node.children[0]}`"
when :optarg
res << "?untyped #{node.children[0]}"
res << "?untyped `#{node.children[0]}`"
when :kwarg
res << "#{node.children[0]}: untyped"
when :kwoptarg
res << "?#{node.children[0]}: untyped"
when :restarg
res << "*untyped #{node.children[0]}"
res << "*untyped `#{node.children[0]}`"
when :kwrestarg
res << "**untyped #{node.children[0]}"
res << "**untyped `#{node.children[0]}`"
when :blockarg
block = " { (*untyped) -> untyped }"
else
Expand Down
4 changes: 2 additions & 2 deletions test/app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ GEM
concurrent-ruby (1.1.8)
crass (1.0.6)
erubi (1.10.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
globalid (0.5.1)
activesupport (>= 5.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
loofah (2.9.1)
Expand Down
2 changes: 1 addition & 1 deletion test/app/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User < ApplicationRecord
scope :all_kind_args, -> (a, m = 1, n = 1, *rest, x, k: 1, **kwrest, &blk) { all }
scope :all_kind_args, -> (type, m = 1, n = 1, *rest, x, k: 1,**untyped, &blk) { all }
scope :no_arg, -> () { all }

has_and_belongs_to_many :blogs
Expand Down
6 changes: 3 additions & 3 deletions test/rbs_rails/active_record_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ def will_save_change_to_updated_at?: () -> bool
def restore_updated_at!: () -> void
def clear_updated_at_change: () -> void

def self.all_kind_args: (untyped a, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped kwrest) { (*untyped) -> untyped } -> ActiveRecord_Relation
def self.all_kind_args: (untyped `type`, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped `untyped`) { (*untyped) -> untyped } -> ActiveRecord_Relation
def self.no_arg: () -> ActiveRecord_Relation

class ActiveRecord_Relation < ActiveRecord::Relation
include _ActiveRecord_Relation[User, Integer]
include Enumerable[User]

def all_kind_args: (untyped a, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped kwrest) { (*untyped) -> untyped } -> ActiveRecord_Relation
def all_kind_args: (untyped `type`, ?untyped m, ?untyped n, *untyped rest, untyped x, ?k: untyped, **untyped `untyped`) { (*untyped) -> untyped } -> ActiveRecord_Relation
def no_arg: () -> ActiveRecord_Relation
end

Expand All @@ -124,7 +124,7 @@ class ActiveRecord_Associations_CollectionProxy < ActiveRecord::Associations::Co
end

def app_dir
File.expand_path('../app', __dir__)
File.expand_path('../app', __dir__)
end

def setup!
Expand Down