mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Skip macro scopes in ShadowingOuterLocalVar
This commit is contained in:
parent
2e9ef7fcb2
commit
614fcfa6a8
2 changed files with 22 additions and 4 deletions
|
@ -235,6 +235,23 @@ module Ameba::Rule::Lint
|
|||
end
|
||||
CRYSTAL
|
||||
end
|
||||
|
||||
# https://github.com/crystal-ameba/ameba/issues/224#issuecomment-822245167
|
||||
it "does not report scoped vars to MacroFor (2)" do
|
||||
expect_no_issues subject, <<-CRYSTAL
|
||||
struct Test
|
||||
def test
|
||||
{% begin %}
|
||||
{% for ivar in @type.instance_vars %}
|
||||
{% var_type = ivar %}
|
||||
{% end %}
|
||||
|
||||
{% ["a", "b"].map { |ivar| puts ivar } %}
|
||||
{% end %}
|
||||
end
|
||||
end
|
||||
CRYSTAL
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue