Skip to content

AspectJ keyword 'before' as lambda argument name causes compile error #325

@MiniShen

Description

@MiniShen
/**
 * [ERROR] error at
 * [ERROR] util(list, (before, cur) -> before < cur);
 * [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^
 * [ERROR] C:\workspace\plugin\aspectjTest\src\main\java\fish\Main.java:44:0::0 The left-hand side of an assignment must be a variable [ERROR] error at [ERROR] util(list, (before, cur) -> before < cur);
 */
public static void test() {
  List<Integer> list = new ArrayList<>();
  //1.compile error
  // util(list, (before, cur) -> before < cur);
  //2.compile success
  util(list, (i1, i2) -> i1 < i2);
  //3.compile success
  util(list, (Integer before, Integer cur) -> before < cur);
}

public static <T> void util(Collection<T> list, BiPredicate<T, T> predicate) {}

jdk version:20
aspectj version :1.9.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    JDT CoreEclipse Java Development Tools (AspectJ fork)bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions