Closed rsmckinney closed 1 year ago
@Structural interface Dog { String getBreed(); void setBreed(String breed); default boolean likes(String thing) { return true; } }
Dog dog = (Dog)new HashMap<>(); dog.setBreed("Foxhound"); ((Map)dog).put("likes", (Function<String,Boolean>)(thing -> !thing.equals("relaxation"))); String breed = dog.getBreed(); out.println(breed); out.println(dog.likes("ball")); out.println(dog.likes("relaxation")); // Bug: prints true, does not call override ^^
Fixed available with release 2023.1.5