Error type with lambda

已回答

Hello,

I have a function that takes a BiFunction<Player, ItemStack, ItemStack> as a parameter. If I use inner anonymous class, Intellij advises me to use a lambda expression. But if I accept, I have errors where I use the parameters : for intellij, they are Object type and not Player and ItemStack.

How I can fix that ?

Note: this problem doesn't occur when I use Predicate<Player>.

0

Please share a sample project/file to reproduce the issue: https://uploads.services.jetbrains.com/ .

0
Avatar
Permanently deleted user

Ok, here the files names :

ItemSlot.java
ItemSlotAction.java
ItemStack.java
Main.java
Material.java
MetaAction.java
Player.java
0

Hello, please clarify, the method

isOnline

is unresolved for me in both cases, while using anonymous class and lambda, is the behaviour the same for you? Thank you 

0
Avatar
Permanently deleted user

No :

I've uploaded this new version of main (the name is the same :

Main.java
0

Thank you for the details provided, please follow the issue created for your report at YouTrack:

https://youtrack.jetbrains.com/issue/IDEA-230029

0

请先登录再写评论。