diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-07-12 04:04:01 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-07-12 04:04:01 +0100 |
commit | 055726e0cbbefa56ddbec35b0c58a7000fe97ebf (patch) | |
tree | 9568e82e1b141867814a70a83a1d0baadc899909 /bridge/src/sbt-test/source-dependencies | |
parent | 6d7bc4996d6ad2095442ebc43f59307448226fd7 (diff) | |
download | dotty-055726e0cbbefa56ddbec35b0c58a7000fe97ebf.tar.gz dotty-055726e0cbbefa56ddbec35b0c58a7000fe97ebf.tar.bz2 dotty-055726e0cbbefa56ddbec35b0c58a7000fe97ebf.zip |
ExtractAPI: Do not miss value parameters of PolyTypes
This bug has been present since we merged this phase.
In the new test `signature-change`, only "Case 1" did not pass before.
Diffstat (limited to 'bridge/src/sbt-test/source-dependencies')
7 files changed, 52 insertions, 0 deletions
diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/B.scala b/bridge/src/sbt-test/source-dependencies/signature-change/B.scala new file mode 100644 index 000000000..e049b23b0 --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/B.scala @@ -0,0 +1,3 @@ +object B { + val x: Int = A.f1[Any](1) +} diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/changes/A0.scala b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A0.scala new file mode 100644 index 000000000..6cf6a62c2 --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A0.scala @@ -0,0 +1,3 @@ +object A { + def f1[T](x: Int): Int = 1 +} diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/changes/A1.scala b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A1.scala new file mode 100644 index 000000000..d10bcbadc --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A1.scala @@ -0,0 +1,3 @@ +object A { + def f1[T](x: String): Int = 1 +} diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/changes/A2.scala b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A2.scala new file mode 100644 index 000000000..029dc28d7 --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A2.scala @@ -0,0 +1,3 @@ +object A { + def f1[T](x: Int): String = "" +} diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/changes/A3.scala b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A3.scala new file mode 100644 index 000000000..69463721f --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/changes/A3.scala @@ -0,0 +1,3 @@ +object A { + def f1[T <: Int](x: Int): Int = 1 +} diff --git a/bridge/src/sbt-test/source-dependencies/signature-change/project/DottyInjectedPlugin.scala b/bridge/src/sbt-test/source-dependencies/signature-change/project/DottyInjectedPlugin.scala new file mode 100644 index 000000000..3433779b6 --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/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/bridge/src/sbt-test/source-dependencies/signature-change/test b/bridge/src/sbt-test/source-dependencies/signature-change/test new file mode 100644 index 000000000..03ad663ab --- /dev/null +++ b/bridge/src/sbt-test/source-dependencies/signature-change/test @@ -0,0 +1,20 @@ +# Case 1: parameter type changed +$ copy-file changes/A0.scala A.scala +> compile +$ copy-file changes/A1.scala A.scala +# Compilation of B.scala should fail because the signature of f changed +-> compile + +# Case 2: return type changed +$ copy-file changes/A0.scala A.scala +> compile +$ copy-file changes/A2.scala A.scala +# Compilation of B.scala should fail because the signature of f changed +-> compile + +# Case 3: type parameter bounds changed +$ copy-file changes/A0.scala A.scala +> compile +$ copy-file changes/A3.scala A.scala +# Compilation of B.scala should fail because the signature of f changed +-> compile |