Skip to content
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

Implement necessary changes to compile with -source:future for scala 3 (towards #361) #364

Merged
merged 2 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ object Printer {
print(
formatProtectionLevel(level),
if (isImplicit) "implicit " else "",
if (isSealed) "sealed " else "",
if (isSealed) "sealed "
else if (scalaVersion.is3 && classType === ClassType.Class) "open "
else "",
classType.asString,
" ",
formatName(name),
Expand Down Expand Up @@ -620,6 +622,8 @@ object Printer {
"js.undefined"
case ExprTree.Null =>
"null"
case ExprTree.`:_*`(e) if scalaVersion.is3 =>
s"${formatExpr(indent)(e)}*"
case ExprTree.`:_*`(e) =>
s"${formatExpr(indent)(e)} :_*"
case ExprTree.Ref(value) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object Versions {
else Dep.Java(scalaOrganization, "scala-library", scalaVersion)

val dottyLibrary: Option[Dep.Java] =
if (is3) Some(Dep.Java(scalaOrganization, "dotty-library", scalaVersion))
if (is3) Some(Dep.Java(scalaOrganization, "scala3-library", scalaVersion))
else None

val binVersion: String = scalaVersion match {
Expand All @@ -46,7 +46,7 @@ object Versions {

val Scala212 = Scala("2.12.14")
val Scala213 = Scala("2.13.5")
val Scala3 = Scala("3.0.1")
val Scala3 = Scala("3.0.2")

case class ScalaJs(scalaJsVersion: String) {
val scalaJsBinVersion: String =
Expand Down Expand Up @@ -82,6 +82,8 @@ case class Versions(scala: Versions.Scala, scalaJs: Versions.ScalaJs) {
"-language:higherKinds",
"-language:existentials",
"-no-indent",
"-source:future",
// "-Yexplicit-nulls"
)
else
List(
Expand Down
6 changes: 3 additions & 3 deletions tests/antd/check-3/a/antd/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "antd"
version := "4.3.1-0e497b"
scalaVersion := "3.0.1"
version := "4.3.1-c8072f"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
6 changes: 3 additions & 3 deletions tests/antd/check-3/r/rc-field-form/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "rc-field-form"
version := "1.4.4-8ef4ea"
scalaVersion := "3.0.1"
version := "1.4.4-838624"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
8 changes: 4 additions & 4 deletions tests/augment-module/check-3/l/lodash/build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
organization := "org.scalablytyped"
name := "lodash"
version := "4.14-d0d30c"
scalaVersion := "3.0.1"
version := "4.14-ff8583"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-adb6ca")
"org.scalablytyped" %%% "std" % "0.0-unknown-f8876f")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
6 changes: 3 additions & 3 deletions tests/augment-module/check-3/l/lodash_dot_add/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "lodash_dot_add"
version := "3.7-fb8f00"
scalaVersion := "3.0.1"
version := "3.7-10be8d"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
6 changes: 3 additions & 3 deletions tests/augment-module/check-3/s/std/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "std"
version := "0.0-unknown-adb6ca"
scalaVersion := "3.0.1"
version := "0.0-unknown-f8876f"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
6 changes: 3 additions & 3 deletions tests/aws-sdk/check-3/a/aws-sdk/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "aws-sdk"
version := "2.247.1-b81990"
scalaVersion := "3.0.1"
version := "2.247.1-124dbd"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ object allMod {

@JSImport("aws-sdk/clients/all", "DynamoDB")
@js.native
class DynamoDB () extends ^ {
open class DynamoDB () extends ^ {
def this(options: ClientConfiguration) = this()
}
object DynamoDB {

@JSImport("aws-sdk/clients/all", "DynamoDB.Converter")
@js.native
class Converter ()
open class Converter ()
extends typings.awsSdk.dynamodbMod.Converter
/* static members */
object Converter {
Expand All @@ -38,7 +38,7 @@ object allMod {
/**
* Creates a DynamoDB document client with a set of configuration options.
*/
class DocumentClient ()
open class DocumentClient ()
extends typings.awsSdk.dynamodbMod.DocumentClient {
def this(options: DocumentClientOptions & ClientConfiguration) = this()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object configMod {
* Creates a new configuration object.
* This is the object that passes option data along to service requests, including credentials, security, region information, and some service specific settings.
*/
class Config () extends StObject {
open class Config () extends StObject {
def this(options: ConfigurationServicePlaceholders & APIVersions) = this()

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object converterMod {

@JSImport("aws-sdk/lib/dynamodb/converter", "Converter")
@js.native
class Converter () extends StObject
open class Converter () extends StObject
/* static members */
object Converter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object documentClientMod {
/**
* Creates a DynamoDB document client with a set of configuration options.
*/
class DocumentClient () extends StObject {
open class DocumentClient () extends StObject {
def this(options: DocumentClientOptions & ClientConfiguration) = this()
}
object DocumentClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ object dynamodbMod {

@JSImport("aws-sdk/clients/dynamodb", JSImport.Namespace)
@js.native
class ^ () extends DynamoDBCustomizations {
open class ^ () extends DynamoDBCustomizations {
def this(options: ClientConfiguration) = this()
}

@JSImport("aws-sdk/clients/dynamodb", "Converter")
@js.native
class Converter ()
open class Converter ()
extends typings.awsSdk.converterMod.Converter
/* static members */
object Converter {
Expand All @@ -36,7 +36,7 @@ object dynamodbMod {
/**
* Creates a DynamoDB document client with a set of configuration options.
*/
class DocumentClient ()
open class DocumentClient ()
extends typings.awsSdk.documentClientMod.DocumentClient {
def this(options: DocumentClientOptions & ClientConfiguration) = this()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ object global {

@JSGlobal("AWS.DynamoDB")
@js.native
class DynamoDB ()
open class DynamoDB ()
extends typings.awsSdk.mod.DynamoDB {
def this(options: ClientConfiguration) = this()
}
object DynamoDB {

@JSGlobal("AWS.DynamoDB.Converter")
@js.native
class Converter ()
open class Converter ()
extends typings.awsSdk.mod.DynamoDB.Converter
/* static members */
object Converter {
Expand All @@ -41,7 +41,7 @@ object global {
/**
* Creates a DynamoDB document client with a set of configuration options.
*/
class DocumentClient ()
open class DocumentClient ()
extends typings.awsSdk.mod.DynamoDB.DocumentClient {
def this(options: DocumentClientOptions & ClientConfiguration) = this()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ object mod {

@JSImport("aws-sdk", "DynamoDB")
@js.native
class DynamoDB ()
open class DynamoDB ()
extends typings.awsSdk.allMod.DynamoDB {
def this(options: ClientConfiguration) = this()
}
object DynamoDB {

@JSImport("aws-sdk", "DynamoDB.Converter")
@js.native
class Converter ()
open class Converter ()
extends typings.awsSdk.allMod.DynamoDB.Converter
/* static members */
object Converter {
Expand All @@ -39,7 +39,7 @@ object mod {
/**
* Creates a DynamoDB document client with a set of configuration options.
*/
class DocumentClient ()
open class DocumentClient ()
extends typings.awsSdk.allMod.DynamoDB.DocumentClient {
def this(options: DocumentClientOptions & ClientConfiguration) = this()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object servicesDynamodbMod {

@JSImport("aws-sdk/lib/services/dynamodb", "DynamoDBCustomizations")
@js.native
class DynamoDBCustomizations () extends StObject
open class DynamoDBCustomizations () extends StObject
/* static members */
object DynamoDBCustomizations {

Expand Down
6 changes: 3 additions & 3 deletions tests/babylon/check-3/b/babylon/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "babylon"
version := "0.0-unknown-72af3d"
scalaVersion := "3.0.1"
version := "0.0-unknown-4b6407"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ object indexMod {

@JSImport("babylonjs/index", "RuntimeAnimation")
@js.native
class RuntimeAnimation ()
open class RuntimeAnimation ()
extends typings.babylon.originalMod.RuntimeAnimation
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ object middleMod {

@JSImport("middle", "RuntimeAnimation")
@js.native
class RuntimeAnimation ()
open class RuntimeAnimation ()
extends typings.babylon.indexMod.RuntimeAnimation
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ object mod {

@JSImport("babylonjs", "RuntimeAnimation")
@js.native
class RuntimeAnimation ()
open class RuntimeAnimation ()
extends typings.babylon.middleMod.RuntimeAnimation
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ object originalMod {

@JSImport("original", "RuntimeAnimation")
@js.native
class RuntimeAnimation () extends StObject
open class RuntimeAnimation () extends StObject
}
6 changes: 3 additions & 3 deletions tests/babylon/check-3/n/node/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "node"
version := "0.0-unknown-0331be"
scalaVersion := "3.0.1"
version := "0.0-unknown-22ba12"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
8 changes: 4 additions & 4 deletions tests/bigint/check-3/b/bigint/build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
organization := "org.scalablytyped"
name := "bigint"
version := "v5.5.3-b73aa8"
scalaVersion := "3.0.1"
version := "v5.5.3-26192f"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-633d00")
"org.scalablytyped" %%% "std" % "0.0-unknown-5dba2e")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ object Test {

inline def setC(value: typings.bigint.BigInt.BigInt): Self = StObject.set(x, "c", value.asInstanceOf[js.Any])

inline def setCVarargs(value: Double*): Self = StObject.set(x, "c", js.Array(value :_*))
inline def setCVarargs(value: Double*): Self = StObject.set(x, "c", js.Array(value*))
}
}
6 changes: 3 additions & 3 deletions tests/bigint/check-3/s/std/build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
organization := "org.scalablytyped"
name := "std"
version := "0.0-unknown-633d00"
scalaVersion := "3.0.1"
version := "0.0-unknown-5dba2e"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
8 changes: 4 additions & 4 deletions tests/chart.js/check-3/c/chart_dot_js/build.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
organization := "org.scalablytyped"
name := "chart_dot_js"
version := "0.0-unknown-a605d5"
scalaVersion := "3.0.1"
version := "0.0-unknown-5918eb"
scalaVersion := "3.0.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-6c8dc3")
"org.scalablytyped" %%% "std" % "0.0-unknown-ef3ab7")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent")
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future")
licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
Loading