File tree 4 files changed +10
-4
lines changed
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 40
40
- shard_file : shard.edge.yml
41
41
crystal_version : latest
42
42
experimental : true
43
- - shard_file : shard.yml
43
+ - shard_file : shard.override. yml
44
44
crystal_version : nightly
45
45
experimental : true
46
46
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change
1
+ dependencies :
2
+ habitat :
3
+ github : luckyframework/habitat
4
+ branch : main
Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ module Lucky::Assignable
89
89
{% sorted_assigns = ASSIGNS .sort_by { |dec |
90
90
has_explicit_value =
91
91
dec.type.is_a?(Metaclass ) ||
92
- dec.type.types.map(& .id).includes?(Nil .id) ||
92
+ dec.type.types.any? { |t |
93
+ (t.is_a?(Metaclass ) || t.is_a?(ProcNotation ) || t.is_a?(Generic )) ? false : t.names.includes?(Nil .id)
94
+ } ||
93
95
! dec.value.is_a?(Nop )
94
96
has_explicit_value ? 1 : 0
95
97
} % }
@@ -98,7 +100,7 @@ module Lucky::Assignable
98
100
{% var = declaration.var % }
99
101
{% type = declaration.type % }
100
102
{% value = declaration.value % }
101
- {% value = nil if type .stringify.ends_with?(" Nil" ) && ! value % }
103
+ {% value = nil if type .stringify.ends_with?(" Nil" ) && value.nil? % }
102
104
@{{ var.id }} : {{ type }}{% if ! value.is_a?(Nop ) % } = {{ value }}{% end % },
103
105
{% end % }
104
106
** unused_exposures
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ module Lucky::Routable
260
260
end
261
261
262
262
{% params_with_defaults = PARAM_DECLARATIONS .select do |decl |
263
- ! decl.value.is_a?(Nop ) || decl.type.is_a?(Union ) && decl.type.types.last.id == Nil .id
263
+ ! decl.value.is_a?(Nop ) || decl.type.is_a?(Union ) && decl.type.resolve.nilable?
264
264
end % }
265
265
{% params_without_defaults = PARAM_DECLARATIONS .reject do |decl |
266
266
params_with_defaults.includes? decl
You can’t perform that action at this time.
0 commit comments