Skip to content

Commit 6c2d8e3

Browse files
committed
v0.8.5
1 parent 89e3dec commit 6c2d8e3

4 files changed

Lines changed: 25 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.8.5] - 2025-10-27
9+
10+
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.8.3...v0.8.5)
11+
12+
### Changes
13+
- Fix the tapioca compiler behaviour with `T.untyped`
14+
815
## [0.8.3] - 2025-10-24
916

1017
[Diff](https://github.com/Verseth/ruby-shale-builder/compare/v0.8.2...v0.8.3)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
shale-builder (0.8.4)
4+
shale-builder (0.8.5)
55
booleans (>= 0.1)
66
shale (< 2.0)
77
sorbet-runtime (> 0.5)

lib/shale/builder/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Shale
44
module Builder
5-
VERSION = '0.8.4'
5+
VERSION = '0.8.5'
66
end
77
end

lib/tapioca/dsl/compilers/shale.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ def decorate
5050
end
5151

5252
if attribute.collection?
53-
getter_without_block_type = "T.nilable(T::Array[#{return_type}])"
53+
getter_without_block_type = wrap_nilable_type(wrap_array_type(return_type))
5454
elsif nilable
55-
getter_without_block_type = "T.nilable(#{return_type})"
55+
getter_without_block_type = wrap_nilable_type(return_type)
5656
else
5757
getter_without_block_type = return_type.to_s
5858
end
@@ -64,9 +64,9 @@ def decorate
6464
setter_type, nilable = shale_type_to_sorbet_setter_type(attribute)
6565
end
6666
if attribute.collection?
67-
setter_type_str = "T.nilable(T::Array[#{setter_type}])"
67+
setter_type_str = wrap_nilable_type(wrap_array_type(setter_type))
6868
elsif nilable
69-
setter_type_str = "T.nilable(#{setter_type})"
69+
setter_type_str = wrap_nilable_type(setter_type)
7070
else
7171
setter_type_str = setter_type.to_s
7272
end
@@ -92,6 +92,18 @@ def decorate
9292

9393
end
9494

95+
sig { params(type: T.untyped).returns(String) }
96+
def wrap_nilable_type(type)
97+
return "T.nilable(#{type})" if type != T.untyped
98+
99+
T.unsafe(type).to_s
100+
end
101+
102+
sig { params(type: T.untyped).returns(String) }
103+
def wrap_array_type(type)
104+
"T::Array[#{type}]"
105+
end
106+
95107
sig do
96108
params(
97109
mod: RBI::Scope,

0 commit comments

Comments
 (0)