-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow calling extension methods on
this
as receiver
- Loading branch information
Showing
5 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Christoph Dreis <[email protected]> | |
DaveLaw <[email protected]> | ||
Dave Brosius <[email protected]> | ||
Dawid Rusin <[email protected]> | ||
Demian Banakh <[email protected]> | ||
Denis Stepanov <[email protected]> | ||
Emil Lundberg <[email protected]> | ||
Enrique da Costa Cambio <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/transform/resource/after-delombok/ExtensionMethodThis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class ExtensionMethodThis { | ||
public void test() { | ||
ExtensionMethodThis.Extensions.hello(this); | ||
hello(); | ||
} | ||
|
||
private void hello() { | ||
} | ||
|
||
static class Extensions { | ||
public static void hello(ExtensionMethodThis self) { | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
test/transform/resource/after-ecj/ExtensionMethodThis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
@ExtensionMethod(ExtensionMethodThis.Extensions.class) class ExtensionMethodThis { | ||
static class Extensions { | ||
Extensions() { | ||
super(); | ||
} | ||
public static void hello(ExtensionMethodThis self) { | ||
} | ||
} | ||
ExtensionMethodThis() { | ||
super(); | ||
} | ||
public void test() { | ||
ExtensionMethodThis.Extensions.hello(this); | ||
hello(); | ||
} | ||
private void hello() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
|
||
@ExtensionMethod(ExtensionMethodThis.Extensions.class) | ||
class ExtensionMethodThis { | ||
public void test() { | ||
this.hello(); | ||
hello(); | ||
} | ||
|
||
private void hello() { | ||
} | ||
|
||
static class Extensions { | ||
public static void hello(ExtensionMethodThis self) { | ||
} | ||
} | ||
} |