scala - How to convert an anonymous function to a method value? -


with code

val foo = list('a', 'b', 'c') astring.forall(foo.contains(_)) 

intellij highlights foo.contains(_) , suggests "anonymous function convertible method value". have researched eta expansion, unable see how improve particular piece of code. ideas?

i believe it's saying have

val foo = list('a', 'b', 'c') astring.forall(foo.contains) 

note we're not explicitly converting foo.contains method here anonymous function.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -