Access the same name project variable from within a task

Hi. I got a question.
I define a project level variable in build.gradle.kts like
val foo=“bar”

Then within a task which already has a property with the same name (foo) I try to access that high level project variable like this:

tasks.named(“taksName”) { //this task has its own property foo defined
val someVar = foo //And I get the tasks’s foo value, but not the project’s one

How can I access the project foo var from within a task in such case?
Thank you!

The one foo is not a project variable, the other is not a task variable.
They are just local variables in the Kotlin Script you are writing to configure project and tasks.
And iirc the visibility rules in Kotlin, the inner foo shadows the outer foo and you cannot access the shadowed one.