aboutsummaryrefslogtreecommitdiff
path: root/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params
diff options
context:
space:
mode:
Diffstat (limited to 'sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params')
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/A.scala6
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/B.scala4
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/changes/A.scala6
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/project/DottyInjectedPlugin.scala17
-rw-r--r--sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/test8
5 files changed, 41 insertions, 0 deletions
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/A.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/A.scala
new file mode 100644
index 000000000..598d266d4
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/A.scala
@@ -0,0 +1,6 @@
+class A
+{
+ implicit def e: E = new E
+ def x(i: Int)(implicit y: E): String = ""
+}
+class E \ No newline at end of file
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/B.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/B.scala
new file mode 100644
index 000000000..3273cdceb
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/B.scala
@@ -0,0 +1,4 @@
+object B extends A
+{
+ val y = x(3)
+} \ No newline at end of file
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/changes/A.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/changes/A.scala
new file mode 100644
index 000000000..2de2c62ee
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/changes/A.scala
@@ -0,0 +1,6 @@
+class A
+{
+ implicit def e: E = new E
+ def x(i: Int)(y: E): String = ""
+}
+class E \ No newline at end of file
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/project/DottyInjectedPlugin.scala b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/project/DottyInjectedPlugin.scala
new file mode 100644
index 000000000..3433779b6
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/project/DottyInjectedPlugin.scala
@@ -0,0 +1,17 @@
+import sbt._
+import Keys._
+
+object DottyInjectedPlugin extends AutoPlugin {
+ override def requires = plugins.JvmPlugin
+ override def trigger = allRequirements
+
+ override val projectSettings = Seq(
+ scalaVersion := "0.1-SNAPSHOT",
+ scalaOrganization := "ch.epfl.lamp",
+ scalacOptions += "-language:Scala2",
+ scalaBinaryVersion := "2.11",
+ autoScalaLibrary := false,
+ libraryDependencies ++= Seq("org.scala-lang" % "scala-library" % "2.11.5"),
+ scalaCompilerBridgeSource := ("ch.epfl.lamp" % "dotty-bridge" % "0.1.1-SNAPSHOT" % "component").sources()
+ )
+}
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/test b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/test
new file mode 100644
index 000000000..5a2bcc0f4
--- /dev/null
+++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/implicit-params/test
@@ -0,0 +1,8 @@
+> compile
+
+# make implicit parameters in A.x be explicit
+$ copy-file changes/A.scala A.scala
+
+# Both A.scala and B.scala need to be recompiled because the parameter section is no longer implicit
+# and it should be a compile error
+-> compile \ No newline at end of file