-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Scala.js 1.10.1. #15713
Upgrade to Scala.js 1.10.1. #15713
Conversation
Both at call site (for native and non-native JS types) and at definition sites (for non-native JS types). Forward port of scala-js/scala-js@1de54d7
This cherry-picks recent commits from play-json's main, to support Scala.js 1.10.1.
It is fine to do this in a patch version, because * The IR version was not changed in 1.10.x. * There was no change in the scalajs-library API.
@mbovel Would you be available to review this PR, perhaps? |
Would that make sense to add a test for this? diff --git a/sjs-compiler-tests/test/scala/dotty/tools/dotc/ScalaJSCompilationTests.scala b/sjs-compiler-tests/test/scala/dotty/tools/dotc/ScalaJSCompilationTests.scala
index ca4f292568..9cac009eb0 100644
--- a/sjs-compiler-tests/test/scala/dotty/tools/dotc/ScalaJSCompilationTests.scala
+++ b/sjs-compiler-tests/test/scala/dotty/tools/dotc/ScalaJSCompilationTests.scala
@@ -33,6 +33,15 @@ class ScalaJSCompilationTests extends ParallelTesting {
).checkExpectedErrors()
}
+ // Positive tests ------------------------------------------------------------
+
+ @Test def posScalaJS: Unit = {
+ implicit val testGroup: TestGroup = TestGroup("posScalaJS")
+ aggregateTests(
+ compileFilesInDir("tests/pos-scalajs", scalaJSOptions),
+ ).checkCompile()
+ }
+
// Run tests -----------------------------------------------------------------
override protected def shouldSkipTestSource(testSource: TestSource): Boolean =
diff --git a/tests/pos-scalajs/i15419.scala b/tests/pos-scalajs/i15419.scala
new file mode 100644
index 0000000000..0631af5f54
--- /dev/null
+++ b/tests/pos-scalajs/i15419.scala
@@ -0,0 +1,9 @@
+import scala.scalajs.js
+
+@js.native
+trait Bar extends js.Object:
+ def baz(dummy: Unit = js.native): Unit = js.native
+
+def bar: Bar = ???
+
+@main def main = bar.baz() |
@@ -1829,7 +1829,15 @@ class JSCodeGen()(using genCtx: Context) { | |||
} | |||
|
|||
case Block(stats, expr) => | |||
js.Block(stats.map(genStat) :+ genStatOrExpr(expr, isStat)) | |||
// #15419 Collapse { <undefined-param>; BoxedUnit } to <undefined-param> | |||
val genStatsAndExpr0 = stats.map(genStat(_)) :+ genStatOrExpr(expr, isStat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, style: did you add the underscore on purpose?
val genStatsAndExpr0 = stats.map(genStat(_)) :+ genStatOrExpr(expr, isStat) | |
val genStatsAndExpr0 = stats.map(genStat) :+ genStatOrExpr(expr, isStat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I always add the underscore on purpose. For some reason I don't trust eta expansion 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! 😄
We get the test for free in the upgrade to Scala.js 1.10.1. ;) Since it's part of the test suite of Scala.js 1.10.1. |
Oh, I see. |
It is fine to do this in a patch version, because
I'm not sure who's available for reviews, these days. Anyone up for it?