Skip to content

Commit

Permalink
Implement necessary changes to compile with -source:future for scal…
Browse files Browse the repository at this point in the history
…a 3 (towards #361)
  • Loading branch information
oyvindberg committed Sep 28, 2021
1 parent 7ac24e2 commit 6be0d3e
Show file tree
Hide file tree
Showing 367 changed files with 761 additions and 755 deletions.
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 @@ -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
4 changes: 2 additions & 2 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"
version := "4.3.1-cecaeb"
scalaVersion := "3.0.1"
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"))
4 changes: 2 additions & 2 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"
version := "1.4.4-862ab7"
scalaVersion := "3.0.1"
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/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"
version := "4.14-0da384"
scalaVersion := "3.0.1"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-adb6ca")
"org.scalablytyped" %%% "std" % "0.0-unknown-a55b7c")
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"))
4 changes: 2 additions & 2 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"
version := "3.7-fbf43d"
scalaVersion := "3.0.1"
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"))
4 changes: 2 additions & 2 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"
version := "0.0-unknown-a55b7c"
scalaVersion := "3.0.1"
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"))
4 changes: 2 additions & 2 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"
version := "2.247.1-cbb02d"
scalaVersion := "3.0.1"
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
4 changes: 2 additions & 2 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"
version := "0.0-unknown-80e378"
scalaVersion := "3.0.1"
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
}
4 changes: 2 additions & 2 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"
version := "0.0-unknown-e22336"
scalaVersion := "3.0.1"
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/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"
version := "v5.5.3-f8e9bf"
scalaVersion := "3.0.1"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-633d00")
"org.scalablytyped" %%% "std" % "0.0-unknown-6875ff")
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*))
}
}
4 changes: 2 additions & 2 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"
version := "0.0-unknown-6875ff"
scalaVersion := "3.0.1"
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/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"
version := "0.0-unknown-0e2de8"
scalaVersion := "3.0.1"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "std" % "0.0-unknown-6c8dc3")
"org.scalablytyped" %%% "std" % "0.0-unknown-911840")
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 @@ -14,7 +14,7 @@ object mod extends Shortcut {

@JSImport("chart.js", JSImport.Namespace)
@js.native
class ^ protected ()
open class ^ protected ()
extends StObject
with typings.chartJs.mod.Chart {
def this(context: String, options: js.Any) = this()
Expand Down Expand Up @@ -75,7 +75,7 @@ object mod extends Shortcut {
/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("chart.js", "Chart")
@js.native
class ChartCls protected ()
open class ChartCls protected ()
extends StObject
with typings.chartJs.mod.Chart {
def this(context: String, options: js.Any) = this()
Expand Down Expand Up @@ -114,7 +114,7 @@ object mod extends Shortcut {

inline def setLabelsUndefined: Self = StObject.set(x, "labels", js.undefined)

inline def setLabelsVarargs(value: (String | js.Array[String])*): Self = StObject.set(x, "labels", js.Array(value :_*))
inline def setLabelsVarargs(value: (String | js.Array[String])*): Self = StObject.set(x, "labels", js.Array(value*))
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/chart.js/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-6c8dc3"
version := "0.0-unknown-911840"
scalaVersion := "3.0.1"
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"))
Loading

0 comments on commit 6be0d3e

Please sign in to comment.