mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Hide name of underlying let's block method
This prevent's defining a bang version of the let value with the same name.
This commit is contained in:
parent
2c0238d178
commit
95ec999bba
1 changed files with 4 additions and 4 deletions
|
@ -86,17 +86,17 @@ module Spectator
|
|||
end
|
||||
|
||||
macro let(name, &block)
|
||||
let!({{name}}!) {{block}}
|
||||
let!(%value) {{block}}
|
||||
|
||||
module Locals
|
||||
@%wrapper : ValueWrapper?
|
||||
|
||||
def {{name.id}}
|
||||
if (wrapper = @%wrapper)
|
||||
wrapper.as(TypedValueWrapper(typeof({{name.id}}!))).value
|
||||
wrapper.as(TypedValueWrapper(typeof(%value))).value
|
||||
else
|
||||
{{name.id}}!.tap do |value|
|
||||
@%wrapper = TypedValueWrapper(typeof({{name.id}}!)).new(value)
|
||||
%value.tap do |value|
|
||||
@%wrapper = TypedValueWrapper(typeof(%value)).new(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue