-
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.
Add structural classes of dynamicApply before inlining
- Loading branch information
1 parent
94f5cdb
commit 019bfdf
Showing
6 changed files
with
55 additions
and
5 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
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,8 @@ | ||
Normal | ||
test | ||
ArraySeq(class java.lang.String, int) | ||
ArraySeq(test, 42) | ||
Transparent | ||
test | ||
ArraySeq(class java.lang.String, int) | ||
ArraySeq(test, 42) |
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,33 @@ | ||
class MyRecord extends Selectable: | ||
def applyDynamic(name: String, paramClasses: Class[_]*)(args: Any*): Any = { | ||
println(name) | ||
println(paramClasses) | ||
println(args) | ||
() | ||
} | ||
|
||
class MyRecordTransparent extends Selectable: | ||
inline transparent def applyDynamic(name: String, paramClasses: Class[_]*)(args: Any*): Any = { | ||
println(name) | ||
println(paramClasses) | ||
println(args) | ||
() | ||
} | ||
|
||
type Person = MyRecord { | ||
def test(a: String, b: Int): Unit | ||
} | ||
|
||
|
||
type PersonTransparent = MyRecordTransparent { | ||
def test(a: String, b: Int): Unit | ||
} | ||
|
||
val person = MyRecord().asInstanceOf[Person] | ||
val personTransparent = MyRecordTransparent().asInstanceOf[PersonTransparent] | ||
|
||
@main def Test: Unit = | ||
println("Normal") | ||
person.test("test", 42) | ||
println("Transparent") | ||
personTransparent.test("test", 42) |