Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix block with no param generation #874

Merged
merged 3 commits into from
Mar 25, 2022
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
5 changes: 4 additions & 1 deletion lib/tapioca/dsl/helpers/param_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# typed: strict
# frozen_string_literal: true

require "tapioca/helpers/signatures_helper"

module Tapioca
module Dsl
module Helpers
module ParamHelper
extend T::Sig
include SignaturesHelper

sig { params(name: String, type: String).returns(RBI::TypedParam) }
def create_param(name, type:)
Expand Down Expand Up @@ -44,7 +47,7 @@ def create_block_param(name, type:)

sig { params(param: RBI::Param, type: String).returns(RBI::TypedParam) }
def create_typed_param(param, type)
RBI::TypedParam.new(param: param, type: type)
RBI::TypedParam.new(param: param, type: sanitize_signature_types(type))
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def helper
# ...
end

sig { params(user_id: Integer).void }
def authenticate(user_id)
sig { params(user_id: Integer, block: T.proc.void).void }
def authenticate(user_id, &block)
# ...
end
end
Expand All @@ -117,8 +117,8 @@ def account; end
sig { params(value: T.untyped).returns(T.untyped) }
def account=(value); end

sig { params(user_id: ::Integer).void }
def authenticate(user_id); end
sig { params(user_id: ::Integer, block: T.proc.void).void }
def authenticate(user_id, &block); end

sig { returns(T.untyped) }
def helper; end
Expand Down