-
-
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.
[fixes #3463] Support argument widening for extension methods
- Loading branch information
Showing
4 changed files
with
48 additions
and
9 deletions.
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
13 changes: 13 additions & 0 deletions
13
test/transform/resource/after-delombok/ExtensionMethodWidening.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,13 @@ | ||
class ExtensionMethodWidening { | ||
public void test() { | ||
String string = "test"; | ||
ExtensionMethodWidening.Extensions.widening(string, 1); | ||
} | ||
|
||
|
||
static class Extensions { | ||
public static String widening(String string, long a) { | ||
return string + " " + a; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
test/transform/resource/after-ecj/ExtensionMethodWidening.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,18 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
@ExtensionMethod({ExtensionMethodWidening.Extensions.class}) class ExtensionMethodWidening { | ||
static class Extensions { | ||
Extensions() { | ||
super(); | ||
} | ||
public static String widening(String string, long a) { | ||
return ((string + " ") + a); | ||
} | ||
} | ||
ExtensionMethodWidening() { | ||
super(); | ||
} | ||
public void test() { | ||
String string = "test"; | ||
ExtensionMethodWidening.Extensions.widening(string, 1); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
test/transform/resource/before/ExtensionMethodWidening.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,15 @@ | ||
import lombok.experimental.ExtensionMethod; | ||
|
||
@ExtensionMethod({ExtensionMethodWidening.Extensions.class}) | ||
class ExtensionMethodWidening { | ||
public void test() { | ||
String string = "test"; | ||
string.widening(1); | ||
} | ||
|
||
static class Extensions { | ||
public static String widening(String string, long a) { | ||
return string + " " + a; | ||
} | ||
} | ||
} |