-
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 failing test when inline method calls forwarder
- Loading branch information
1 parent
4fe49cc
commit ae4ceba
Showing
7 changed files
with
85 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package a | ||
|
||
import scala.annotation.unroll | ||
|
||
object A { | ||
|
||
def foo(s: String, x: Int, @unroll b: Boolean = true): String = s + x + b | ||
|
||
} |
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 @@ | ||
package a | ||
|
||
import scala.annotation.unroll | ||
|
||
object A { | ||
|
||
def foo(s: String, x: Int): String = s + x | ||
|
||
} |
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 @@ | ||
package b | ||
|
||
import a.* | ||
|
||
object B { | ||
transparent inline def caller = A.foo("abc", 2) | ||
} |
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,36 @@ | ||
lazy val commonSettings = Seq( | ||
scalacOptions += "-experimental", | ||
) | ||
|
||
lazy val printSettings = Seq( | ||
scalacOptions += "-Yprint-tasty", | ||
) | ||
|
||
lazy val a = project.in(file("a")) | ||
.settings(commonSettings) | ||
.settings( | ||
Compile / classDirectory := (ThisBuild / baseDirectory).value / "b-input" | ||
) | ||
|
||
lazy val b = project.in(file("b")) | ||
.settings(commonSettings) | ||
.settings( | ||
Compile / unmanagedClasspath += (ThisBuild / baseDirectory).value / "b-input", | ||
Compile / classDirectory := (ThisBuild / baseDirectory).value / "c-input" | ||
) | ||
|
||
lazy val `a-changes` = project.in(file("a-changes")) | ||
.settings(commonSettings) | ||
.settings( | ||
Compile / classDirectory := (ThisBuild / baseDirectory).value / "c-input" | ||
) | ||
|
||
lazy val c = project.in(file("c")) | ||
.settings(commonSettings) | ||
.settings(printSettings) | ||
.settings( | ||
// scalacOptions ++= Seq("-from-tasty", "-Ycheck:readTasty", "-Xfatal-warnings", "-Xprint:readTasty", "-Xprint-types"), | ||
// Compile / sources := Seq(new java.io.File("c-input/B.tasty")), | ||
Compile / unmanagedClasspath += (ThisBuild / baseDirectory).value / "c-input", | ||
Compile / classDirectory := (ThisBuild / baseDirectory).value / "c-output" | ||
) |
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,5 @@ | ||
import b.* | ||
|
||
object C { | ||
val res = B.caller | ||
} |
11 changes: 11 additions & 0 deletions
11
sbt-test/tasty-compat/add-param-unroll/project/DottyInjectedPlugin.scala
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,11 @@ | ||
import sbt._ | ||
import Keys._ | ||
|
||
object DottyInjectedPlugin extends AutoPlugin { | ||
override def requires = plugins.JvmPlugin | ||
override def trigger = allRequirements | ||
|
||
override val projectSettings = Seq( | ||
scalaVersion := sys.props("plugin.scalaVersion") | ||
) | ||
} |
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 @@ | ||
# compile library A | ||
> a/compile | ||
# compile library B, from source, against A | ||
> b/compile | ||
# add a new parameter in method to library A', using @unroll to generate a forwarder | ||
> a-changes/compile | ||
# compile B, from tasty, against A', it should still compile: the generated forwarder is resolved. | ||
> c/compile |