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

@ExtensionMethod in eclipse with 'Class.foo();' or just 'foo()', where the extension is on Object, causes weird stuff to happen. #479

Closed
lombokissues opened this Issue Jul 14, 2015 · 5 comments

Comments

Projects
None yet
1 participant
@lombokissues
Collaborator

lombokissues commented Jul 14, 2015

Migrated from Google Code (issue 406)

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Aug 12, 2012 at 21:37 UTC

Example code:

@ lombok.experimental.ExtensionMethod(Exts.class)
public class Test {
public static void main(String[] args) {
main2();
}

public static void main2() {
    System.out.println(foo());
}

}

class Exts {
public static int foo(Object o) {
System.out.println(o);
return 5;
}
}

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Aug 12, 2012 at 21:37 UTC

Example code:

@ lombok.experimental.ExtensionMethod(Exts.class)
public class Test {
public static void main(String[] args) {
main2();
}

public static void main2() {
    System.out.println(foo());
}

}

class Exts {
public static int foo(Object o) {
System.out.println(o);
return 5;
}
}

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Aug 13, 2012 at 00:49 UTC

Fixed, just in time for 0.11.4. Caught the following weirdnesses in ecj:

super.extMethod();

extMethod();

Object.extMethod();

fixed both for the autocomplete offers and the actual compilation/compile errors, which are different patches.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Aug 13, 2012 at 00:49 UTC

Fixed, just in time for 0.11.4. Caught the following weirdnesses in ecj:

super.extMethod();

extMethod();

Object.extMethod();

fixed both for the autocomplete offers and the actual compilation/compile errors, which are different patches.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 jose.illescas   🕗 Aug 14, 2012 at 09:00 UTC

This fix generate compilation errors, but exist another alternative:

In your example:

 public static void main2() {
 System.out.println(foo());
 }

Can be replaced with: use current class as first argument

 public static void main2() {
 System.out.println(Test.class.foo());
 }
Collaborator

lombokissues commented Jul 14, 2015

👤 jose.illescas   🕗 Aug 14, 2012 at 09:00 UTC

This fix generate compilation errors, but exist another alternative:

In your example:

 public static void main2() {
 System.out.println(foo());
 }

Can be replaced with: use current class as first argument

 public static void main2() {
 System.out.println(Test.class.foo());
 }
@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

👤 reinierz   🕗 Aug 14, 2012 at 10:30 UTC

Not relevant for this fix; that is an entirely different feature.

Please discuss further on the newsgroup.

Collaborator

lombokissues commented Jul 14, 2015

👤 reinierz   🕗 Aug 14, 2012 at 10:30 UTC

Not relevant for this fix; that is an entirely different feature.

Please discuss further on the newsgroup.

@lombokissues

This comment has been minimized.

Show comment
Hide comment
@lombokissues

lombokissues Jul 14, 2015

Collaborator

End of migration

Collaborator

lombokissues commented Jul 14, 2015

End of migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment