-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle binding of beta reduced inlined lambdas
Handle all inline beta-reduction in the InlineReducer. All these applications will contain `Inlined` nodes that need to be handled without changing the nestedness of expressions in inlining scopes. Fixes #16374
- Loading branch information
1 parent
b4f8eef
commit d0a17ce
Showing
4 changed files
with
54 additions
and
29 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
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
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,7 @@ | ||
def method(using String): String = ??? | ||
|
||
inline def inlineMethod(inline op: String => Unit)(using String): Unit = | ||
println(op(method)) | ||
|
||
def test(using String) = | ||
inlineMethod(c => print(c)) |
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,9 @@ | ||
def method(using String): String = ??? | ||
|
||
inline def identity[T](inline x: T): T = x | ||
|
||
inline def inlineMethod(inline op: String => Unit)(using String): Unit = | ||
println(identity(op)(method)) | ||
|
||
def test(using String) = | ||
inlineMethod(c => print(c)) |