---
title: "Discussion on \"Why does a method defined in an outer scope takes precedence of a method defined in an inner scope?\" | Hashnode"
description: "Discussion on \"Why does a method defined in an outer scope takes precedence of a method defined in an inner scope?\". The Groovy SDK loop methods (e.g. each) use the default closure resolve strategy OWNER_FIRST and thus methods from an outer scope take precedence over methods from inner scopes.\nThe problem can be solved by calling the delegate of the closure directl..."
url: "https://hashnode.com/posts/why-does-a-method-defined-in-an-outer-scope-takes-precedence-of-a-method-defined-in-an-inner-scope/679e5f93abc096f9feb624ce"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why does a method defined in an outer scope takes precedence of a method defined in an inner scope?](https://blogs.sretribe.net/why-does-a-method-defined-in-an-outer-scope-takes-precedence-of-a-method-defined-in-an-inner-scope?utm_source=hashnode&utm_medium=feed)

The Groovy SDK loop methods (e.g. each) use the default closure resolve strategy OWNER\_FIRST and thus methods from an outer scope take precedence over methods from inner scopes. The problem can be solved by calling the delegate of the closure directl...

Feb 1, 2025 · 2 min read · blogs.sretribe.net  
Read the article

## Written by

[Fizzy](https://hashnode.com/@fiizzy)

@fiizzy

  
[View profile](https://hashnode.com/@fiizzy)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
