Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrecognized static method call from within closure #502

Closed
mauromol opened this issue Feb 28, 2018 · 5 comments
Closed

Unrecognized static method call from within closure #502

mauromol opened this issue Feb 28, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@mauromol
Copy link

Consider this:

package test25
class Test25 {
	static void foo() {
		String a = 'a'
		File b = new File()
		new Object().each {
			bar(a, b)
		}
	}
	
	static void bar(String a, File b) {
		
	} 
}

The call to Test25.bar(String, File) from Test25.foo() (inside the closure) is not recognized: it's underlined and navigation with F3 or Ctrl+Click does not work correctly.

@eric-milles eric-milles added this to the v3.0.0 milestone Feb 28, 2018
@eric-milles
Copy link
Member

If static is removed from foo, the reference is resolved. It is missed from a static scope because Class<Test25> is being passed around in the type inferencer.

@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

mauromol commented Mar 1, 2018

Tested with 3.0.0.xx-201802282219-e47: the above use case works, but this does not work yet (i.e.: closure inside closure):

package test25
class Test25 {
	static void foo() {
		String a = 'a'
		File b = new File()
		new Object().each {
			new Object().each {
				bar(a, b)
			}
		}
	}
	
	static void bar(String a, File b) {
	
	} 
}

eric-milles added a commit that referenced this issue Mar 1, 2018
@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

mauromol commented Mar 2, 2018

With 3.0.0.xx-201803020428-e47 even the case of static call in closure-inside-closure works, thank you!

@mauromol mauromol closed this as completed Mar 2, 2018
@eric-milles eric-milles self-assigned this Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants